make 3 part
This commit is contained in:
parent
8dd536eae9
commit
7a3a8fcee6
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
.venv/
|
.venv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
output.txt
|
output.txt
|
||||||
|
.env
|
||||||
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
certifi==2026.2.25
|
certifi==2026.2.25
|
||||||
charset-normalizer==3.4.7
|
charset-normalizer==3.4.7
|
||||||
|
dotenv==0.9.9
|
||||||
idna==3.11
|
idna==3.11
|
||||||
|
python-dotenv==1.2.2
|
||||||
requests==2.33.1
|
requests==2.33.1
|
||||||
urllib3==2.6.3
|
urllib3==2.6.3
|
||||||
|
|||||||
14
work_with_api.py
Normal file
14
work_with_api.py
Normal 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)
|
||||||
Loading…
Reference in New Issue
Block a user