D-link
d-link is a Python library designed to extract data from a Python script and push it to a GitHub Pages repository. This allows you to dynamically update content on your GitHub Pages site based on values from your Python code.
Features
- Extract constants and other data from Python scripts.
- Push extracted data to a GitHub Pages repository.
- Easy setup and configuration.
Installation
You can install the d_link library using pip:
pip install d_link
Usage
1. Configure the Repository
First, configure the GitHub repository URL and authentication token:
from d_link import DataToGitHub
# Initialize DataToGitHub with the path to your Python script
data_to_github = DataToGitHub(script_path="path/to/your/script.py")
# Configure the repository (run this once)
data_to_github.configure_repository()
# Optionally, display current settings
data_to_github.display_settings()
2. Push Data to GitHub
Once configured, you can push data from your Python script to GitHub Pages:
from d_link import DataToGitHub
# Initialize DataToGitHub with the path to your Python script
data_to_github = DataToGitHub(script_path="path/to/your/script.py")
# Push data from the Python script to GitHub Pages
data_to_github.push_data()
Configuration
The configure_repository method prompts you to enter:
- GitHub Repository URL: The URL of the GitHub repository where you want to push data.
- GitHub Personal Access Token: Used for authentication with GitHub.
Ensure that the GitHub Pages site is set up to display or use the data in data.json.
Troubleshooting
- Library Not Found: Ensure the library is installed with
pip install d_link. Verify installation withpip show d_link. - Path Issues: Confirm that the file paths in your script are correct and accessible.
- Authentication Errors: Verify your GitHub personal access token and repository URL are accurate and have the necessary permissions.
Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or issues, please open an issue on the GitHub repository or contact Web Wizard.
Metadata
Release files for d-link 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| d_link-0.2.4.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| d_link-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / d_link-0.2.4.tar.gz
| Download URL | d_link-0.2.4.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fb9910ddc36ccc3c25d8d1f8516874fbf9afbee8a3547b1c481baa93c5626a7
|
|
BLAKE2b-256 checksum How to use checksums |
114f4ada078b4cde2ac531e77ec00a9f87c8ccd24ba83e320954fe2e685b8de2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / d_link-0.2.4-py3-none-any.whl
| Download URL | d_link-0.2.4-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ec73fb535fee91be1e44f5fa32b6c70baa78b76d5ab00351a5b8b8b019b3850
|
|
BLAKE2b-256 checksum How to use checksums |
cd6e2aead191f09548d53bc802958dbf420b4c88ec181387aefca228fe90ad37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|