ServerGit


NameServerGit JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryServe não oficial do GitHub!
upload_time2025-08-01 15:14:28
maintainerNone
docs_urlNone
authorJoão Victor
requires_pythonNone
licenseMIT License
keywords servergit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ServerGit

GitSys is a Python library designed to simplify interaction with GitHub repositories using the GitHub API via [PyGithub]. It allows developers to automate common GitHub operations such as repository creation, file manipulation, and data table management, all while maintaining a detailed log of actions for transparency and debugging.

---

## 🚀 Features

- ✅ Connect to GitHub using a personal access token (PAT)
- 📁 Create, update, read, and delete files/folders in a repository
- 🏗️ Create, edit, and delete GitHub repositories
- 📜 Maintain a log of operations via `NOTA.json`
- 🧾 Manage structured data tables (as JSON files)
- 📊 Convert structured tables into pandas DataFrames
- 🔁 Fully programmatic GitHub automation
- 🧠 Introspective logging of system events
- 📦 Modular structure with internal classes for files, repositories, and server logic

---

## 📦 Requirements

- Python 3.8+
- [PyGithub](https://github.com/PyGithub/PyGithub)
- pandas

Install dependencies:

```bash
pip install PyGithub pandas

GitSys
│
├── REPO           # Create/edit/delete repositories
├── GitFiles       # Create/upload/download/delete files and folders
├── server         # Create/manage classes, tables, and data structures in JSON
└── nota()         # Log actions to NOTA.json


from gitpy import GitSys

gitsys = GitSys(token='your_github_token', full_repo_name='username/repo_name')


🏗️ Repository Operations
repo = gitsys.REPO(master=gitsys, repo_name='my-repo')
repo.create_repo(description='Created via GitSys', private=True)
repo.edit_repo(new_name='updated-repo-name')
repo.delete_repo()

📁 File and Folder Operations
files = gitsys.GitFiles(master=gitsys, repo=gitsys.get())

files.create_folder('my_folder')
files.create_file('my_folder/readme.txt', 'Hello World!')
files.upload_file(local_path='local.txt', repo_path='repo_folder/uploaded.txt')
files.download_file(repo_path='repo_folder/uploaded.txt', local_path='downloaded.txt')
content = files.read_file('my_folder/readme.txt')
files.update_file('my_folder/readme.txt', 'Updated Content')
files.delete_file('my_folder/readme.txt')

📊 Data Table Management
GitSys lets you create and manage structured JSON tables within GitHub repos.

server = gitsys.server(master=gitsys, repo=gitsys.get())

# Create class and table
_class = server.create_class('Students')
table = server.create_table(_class, 'grades')

# Add dictionary (record)
server.create_dict(table, 'Alice')
server.insert_value(table, 'Alice', ['grade', 'A+'])

# Read and update
server.update_value(table, 'Alice', ['grade', 'A'])
record = server.get_value(table, 'Alice')

# Convert to DataFrame
df = server.data_frame_value(table, values=['__name__', 'grade'])
print(df)

📓 Logging Actions
Every major GitHub operation is logged to a NOTA.json file in the repository.

gitsys.nota(save=True, _print=True)

📌 Example Use Cases
Automating classroom or student data storage in GitHub repos

GitHub-based version control for JSON data structures

Creating educational or collaborative repositories on the fly

Remote logging of repository events and changes

✅ Best Practices
Always store your GitHub tokens securely (use .env or secret managers)

Avoid committing NOTA.json manually; let GitSys manage it

Use separate repositories for structured data vs source code

Clean up test repos with delete_repo() to avoid clutter

📄 License
This project is licensed under the MIT License. See the LICENSE file for more information.

🤝 Contributing
Contributions are welcome! Feel free to fork, open issues, or submit pull requests. If you have feature requests or want to integrate GitSys into larger automation pipelines, open a discussion.

📬 Contact
Created by [Your Name] — feel free to reach out for suggestions or collaboration.


Se quiser, posso também gerar o arquivo pronto para download ou incluir instruções de testes unitários/documentação automática. É só avisar!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ServerGit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "ServerGit",
    "author": "Jo\u00e3o Victor",
    "author_email": "ajaxbytestudio@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/7c/16aa18dbe623160293d6ee14ccb9c8c582f1637abf0b3c9c851184879655/servergit-0.0.2.tar.gz",
    "platform": null,
    "description": "# ServerGit\r\n\r\nGitSys is a Python library designed to simplify interaction with GitHub repositories using the GitHub API via [PyGithub]. It allows developers to automate common GitHub operations such as repository creation, file manipulation, and data table management, all while maintaining a detailed log of actions for transparency and debugging.\r\n\r\n---\r\n\r\n## \ud83d\ude80 Features\r\n\r\n- \u2705 Connect to GitHub using a personal access token (PAT)\r\n- \ud83d\udcc1 Create, update, read, and delete files/folders in a repository\r\n- \ud83c\udfd7\ufe0f Create, edit, and delete GitHub repositories\r\n- \ud83d\udcdc Maintain a log of operations via `NOTA.json`\r\n- \ud83e\uddfe Manage structured data tables (as JSON files)\r\n- \ud83d\udcca Convert structured tables into pandas DataFrames\r\n- \ud83d\udd01 Fully programmatic GitHub automation\r\n- \ud83e\udde0 Introspective logging of system events\r\n- \ud83d\udce6 Modular structure with internal classes for files, repositories, and server logic\r\n\r\n---\r\n\r\n## \ud83d\udce6 Requirements\r\n\r\n- Python 3.8+\r\n- [PyGithub](https://github.com/PyGithub/PyGithub)\r\n- pandas\r\n\r\nInstall dependencies:\r\n\r\n```bash\r\npip install PyGithub pandas\r\n\r\nGitSys\r\n\u2502\r\n\u251c\u2500\u2500 REPO           # Create/edit/delete repositories\r\n\u251c\u2500\u2500 GitFiles       # Create/upload/download/delete files and folders\r\n\u251c\u2500\u2500 server         # Create/manage classes, tables, and data structures in JSON\r\n\u2514\u2500\u2500 nota()         # Log actions to NOTA.json\r\n\r\n\r\nfrom gitpy import GitSys\r\n\r\ngitsys = GitSys(token='your_github_token', full_repo_name='username/repo_name')\r\n\r\n\r\n\ud83c\udfd7\ufe0f Repository Operations\r\nrepo = gitsys.REPO(master=gitsys, repo_name='my-repo')\r\nrepo.create_repo(description='Created via GitSys', private=True)\r\nrepo.edit_repo(new_name='updated-repo-name')\r\nrepo.delete_repo()\r\n\r\n\ud83d\udcc1 File and Folder Operations\r\nfiles = gitsys.GitFiles(master=gitsys, repo=gitsys.get())\r\n\r\nfiles.create_folder('my_folder')\r\nfiles.create_file('my_folder/readme.txt', 'Hello World!')\r\nfiles.upload_file(local_path='local.txt', repo_path='repo_folder/uploaded.txt')\r\nfiles.download_file(repo_path='repo_folder/uploaded.txt', local_path='downloaded.txt')\r\ncontent = files.read_file('my_folder/readme.txt')\r\nfiles.update_file('my_folder/readme.txt', 'Updated Content')\r\nfiles.delete_file('my_folder/readme.txt')\r\n\r\n\ud83d\udcca Data Table Management\r\nGitSys lets you create and manage structured JSON tables within GitHub repos.\r\n\r\nserver = gitsys.server(master=gitsys, repo=gitsys.get())\r\n\r\n# Create class and table\r\n_class = server.create_class('Students')\r\ntable = server.create_table(_class, 'grades')\r\n\r\n# Add dictionary (record)\r\nserver.create_dict(table, 'Alice')\r\nserver.insert_value(table, 'Alice', ['grade', 'A+'])\r\n\r\n# Read and update\r\nserver.update_value(table, 'Alice', ['grade', 'A'])\r\nrecord = server.get_value(table, 'Alice')\r\n\r\n# Convert to DataFrame\r\ndf = server.data_frame_value(table, values=['__name__', 'grade'])\r\nprint(df)\r\n\r\n\ud83d\udcd3 Logging Actions\r\nEvery major GitHub operation is logged to a NOTA.json file in the repository.\r\n\r\ngitsys.nota(save=True, _print=True)\r\n\r\n\ud83d\udccc Example Use Cases\r\nAutomating classroom or student data storage in GitHub repos\r\n\r\nGitHub-based version control for JSON data structures\r\n\r\nCreating educational or collaborative repositories on the fly\r\n\r\nRemote logging of repository events and changes\r\n\r\n\u2705 Best Practices\r\nAlways store your GitHub tokens securely (use .env or secret managers)\r\n\r\nAvoid committing NOTA.json manually; let GitSys manage it\r\n\r\nUse separate repositories for structured data vs source code\r\n\r\nClean up test repos with delete_repo() to avoid clutter\r\n\r\n\ud83d\udcc4 License\r\nThis project is licensed under the MIT License. See the LICENSE file for more information.\r\n\r\n\ud83e\udd1d Contributing\r\nContributions are welcome! Feel free to fork, open issues, or submit pull requests. If you have feature requests or want to integrate GitSys into larger automation pipelines, open a discussion.\r\n\r\n\ud83d\udcec Contact\r\nCreated by [Your Name] \u2014 feel free to reach out for suggestions or collaboration.\r\n\r\n\r\nSe quiser, posso tamb\u00e9m gerar o arquivo pronto para download ou incluir instru\u00e7\u00f5es de testes unit\u00e1rios/documenta\u00e7\u00e3o autom\u00e1tica. \u00c9 s\u00f3 avisar!\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Serve n\u00e3o oficial do GitHub!",
    "version": "0.0.2",
    "project_urls": null,
    "split_keywords": [
        "servergit"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fa7c16aa18dbe623160293d6ee14ccb9c8c582f1637abf0b3c9c851184879655",
                "md5": "5c26c1ae052aaa9fc35f38f0a6178e06",
                "sha256": "e229b1579ae2ae60d8d60b8e7e27c24513392975f18feba8fd60cfbc08e2a74b"
            },
            "downloads": -1,
            "filename": "servergit-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5c26c1ae052aaa9fc35f38f0a6178e06",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10083,
            "upload_time": "2025-08-01T15:14:28",
            "upload_time_iso_8601": "2025-08-01T15:14:28.736281Z",
            "url": "https://files.pythonhosted.org/packages/fa/7c/16aa18dbe623160293d6ee14ccb9c8c582f1637abf0b3c9c851184879655/servergit-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-01 15:14:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "servergit"
}
        
Elapsed time: 0.70413s