Skip to main content

a small python library to get code from github repositories.

Project description

Get code from GitHub

pypi CodeFactor

this is a small python library to get code from github repositories

How to install

pip3 install get_github_code

Usage

is easy to use

from get_github_code import get_code

code = get_code(
    user="Vlad2030",
    repo="get-code-from-github",
    branch="main",
    file_path="VERSION",
)

print(code)
# 0.2.1

or asynchronous

import asyncio
from get_github_code import async_get_code

async def main() -> None:
    code = await async_get_code(
        user="Vlad2030",
        repo="get-code-from-github",
        branch="main",
        file_path="VERSION",
    )

    print(code)

asyncio.run(main())
# 0.2.1

additionally you can through the class by calling property

import asyncio
from get_github_code import GetCode

file = GetCode(
    user="Vlad2030",
    repo="get-code-from-github",
    branch="main",
    file_path="VERSION",
)

print(file.get_code)
# 0.2.1

async def main() -> None:
    file = GetCode(
        user="Vlad2030",
        repo="get-code-from-github",
        branch="main",
        file_path="VERSION",
    )

    print(file.async_get_code)

asyncio.run(main())
# 0.2.1

Documentation

How to install

Classes/GetCode

functions/get_code

functions/async_get_code

2023, version 0.2.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

get_github_code-0.2.1.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

get_github_code-0.2.1-py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page