Convenient access to massive corpus of GitHub repositories
Project description
MAGI Dataset
Install
pip install magi_dataset
If you plan on using magi_dataset to periodically crawl data, set the following variables in your environment:
export GH_TOKEN="Your token"
Read Creating a personal access token for more information on creating GitHub personal access token. If using the default data without crawling new data, you may safely ignore this token.
Usage
The recommended way to use magi_dataset is to run the collection process in chunked mode. First create an empty dataset and initiate index from GitHub:
</code></pre>
<p>Initialize an empty instance and collect data:</p>
<pre><code class="language-python">>>> from magi_dataset import GitHubDataset
>>> github_dataset = GitHubDataset(
... empty = True
... )
github_dataset.init_repos(fully_initialize=True)
Download default data (not guranteed to be the newest):
>>> from magi_dataset import GitHubDataset
>>> github_dataset3 = GitHubDataset(
... empty = False
... )
The default data may be found at Enoch2090/github_semantic_search on HuggingFace. We will update the data periodically.
After the dataset is created, access the data with either number index:
>>> github_dataset[5]
GitHubRepo(name='ytdl-org/youtube-dl', stars=114798, description='Command-line program to download videos from YouTube.com and other video sites', _fully_initialized=True)
Or the full name:
>>> github_dataset['ytdl-org/youtube-dl']
GitHubRepo(name='ytdl-org/youtube-dl', stars=114798, description='Command-line program to download videos from YouTube.com and other video sites', _fully_initialized=True)
And you can access the corpus by accessing the readme and hn_comments attributes of GitHubRepo objects.
>>> github_dataset[5].readme[0:100]
'[](https'
Future Works
- The current idle handler design is primordial, will switch to async pipelines to relieve CPU sleep time.
- Elasticsearch database builder
- Pinecone database builder (wrapper only)
- Hash verification of persistence files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magi_dataset-1.0.4-py3-none-any.whl.
File metadata
- Download URL: magi_dataset-1.0.4-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e69055bfe4d17012f7a6f6f9521db23abc032f117af148bd9e218b455cd020d
|
|
| MD5 |
7b3c80886cc0e7c73ff454d2d817261e
|
|
| BLAKE2b-256 |
255ccb369b365ed9c352b73bd6e95c72d6dd90c16d5c1a738297cec2babffb31
|