make 3 part

This commit is contained in:
Crai-cry 2026-04-18 22:26:49 +03:00
parent 8dd536eae9
commit 7a3a8fcee6
4 changed files with 33 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
.venv/
__pycache__/
*.pyc
output.txt
output.txt
.env

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

View File

@ -1,5 +1,7 @@
certifi==2026.2.25
charset-normalizer==3.4.7
dotenv==0.9.9
idna==3.11
python-dotenv==1.2.2
requests==2.33.1
urllib3==2.6.3

14
work_with_api.py Normal file
View File

@ -0,0 +1,14 @@
import os
import requests
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("read_and_write")
headers = {"Authorization": f"token {TOKEN}"}
response = requests.get("https://git.vyatsu.ru/api/v1/user", headers=headers)
print(response.json())
data = {
"name": "api_repo",
"description": "Создано через API",
"private": False,
}
requests.post("https://git.vyatsu.ru/api/v1/user/repos",headers=headers,json = data)