{"id":27168395,"url":"https://github.com/pyfunc/lib","last_synced_at":"2026-03-16T04:04:04.680Z","repository":{"id":182351928,"uuid":"668338215","full_name":"pyfunc/lib","owner":"pyfunc","description":"all libs for cameramonit, cfo, ... projects","archived":false,"fork":false,"pushed_at":"2025-05-05T22:05:57.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T21:11:25.939Z","etag":null,"topics":["docker","ocr","pydock","pyfunc","templates"],"latest_commit_sha":null,"homepage":"http://lib.pyfunc.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyfunc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-19T15:08:56.000Z","updated_at":"2025-05-05T22:06:01.000Z","dependencies_parsed_at":"2024-01-21T17:27:08.451Z","dependency_job_id":"1be8b1e0-62da-4e3b-9f01-4f346abd12ba","html_url":"https://github.com/pyfunc/lib","commit_stats":null,"previous_names":["pyfunc/lib"],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/pyfunc/lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfunc%2Flib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfunc%2Flib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfunc%2Flib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfunc%2Flib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyfunc","download_url":"https://codeload.github.com/pyfunc/lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyfunc%2Flib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261374325,"owners_count":23148970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","ocr","pydock","pyfunc","templates"],"created_at":"2025-04-09T05:31:47.737Z","updated_at":"2026-03-16T04:04:04.674Z","avatar_url":"https://github.com/pyfunc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [pyfunc2](http://lib.pyfunc.com)\n\nlibs for cameramonit, ocr, fin-officer, cfo, and other projects\n\n\n## Install\n\n\n```bash\npip install pyfunc2\n```\n\n```bash\ngit clone https://github.com/pyfunc/lib.git pyfunc\n```\n\n\n## Contributing\n\n```bash\npython3 -m venv pytest-env\nsource pytest-env/bin/activate\n```\n\n```bash\npip install --upgrade pip\npip install pytest\n```\n\nrun the test, execute the pytest command:\n```bash\npytest\n```\n\n\n\n## Tips\n\nsimple method to generate a requirements.txt file is to pipe them,\n```bash\npip freeze \u003e requirements.txt\npip freeze \u003e requirements/runtime.txt\n```\n\n## if push not possible\n\n```\n[remote rejected] (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/python-app.yml` without `workflow` scope)\n```\n\nProblem z odrzuceniem tokena dostępu osobistego (Personal Access Token, PAT) podczas próby aktualizacji pliku workflow, \nmusisz zaktualizować uprawnienia swojego tokena. \n\n### Oto kroki, które powinieneś podjąć:\n\n1. Przejdź do ustawień GitHub:\n   - Kliknij na swój awatar w prawym górnym rogu GitHub\n   - Wybierz \"Settings\"\n\n2. Przejdź do ustawień deweloperskich:\n   - W lewym menu wybierz \"Developer settings\"\n\n3. Zarządzaj tokenami dostępu:\n   - Wybierz \"Personal access tokens\"\n   - Następnie \"Tokens (classic)\"\n\n4. Utwórz nowy token lub zaktualizuj istniejący:\n   - Jeśli tworzysz nowy, kliknij \"Generate new token\"\n   - Jeśli aktualizujesz istniejący, znajdź odpowiedni token i kliknij \"Edit\"\n\n5. Dodaj uprawnienie \"workflow\":\n   - Przewiń do sekcji \"Select scopes\"\n   - Zaznacz pole obok \"workflow\"\n\n6. Zapisz zmiany:\n   - Przewiń na dół i kliknij \"Generate token\" (dla nowego) lub \"Update token\" (dla istniejącego)\n\n7. Skopiuj nowy token:\n   - Upewnij się, że skopiowałeś nowy token, ponieważ nie będziesz mógł go zobaczyć ponownie\n\n8. Zaktualizuj token w swoim lokalnym repozytorium:\n   - Jeśli używasz HTTPS, zaktualizuj swoje dane logowania\n   - Jeśli używasz SSH, upewnij się, że Twój klucz SSH jest poprawnie skonfigurowany\n\n9. Spróbuj ponownie wykonać push:\n   - Użyj nowego tokena do autoryzacji\n\nPamiętaj, że tokeny dostępu osobistego są bardzo wrażliwe na bezpieczeństwo.\nTraktuj je jak hasła i nigdy nie udostępniaj ich publicznie. Jeśli przypadkowo ujawnisz swój token, natychmiast go usuń i wygeneruj nowy.\n\nPo wykonaniu tych kroków, powinieneś być w stanie zaktualizować plik workflow bez problemów. Jeśli nadal napotkasz problemy, upewnij się, że masz odpowiednie uprawnienia w repozytorium i że workflow nie są zablokowane przez ustawienia organizacji lub repozytorium.\n\n# update PAT in repo\nour local repo and want to push it to a remote repo.\n\ncreate a PAT (personal access token): official doc here. Make sure to tick the box \"workflow\" when creating it.\nIn the terminal, instead of the classic\n\n```bash\ngit remote add origin https://github.com/\u003caccount\u003e/\u003crepo\u003e.git\n```\n\nswap it by\n```bash\ngit remote add origin https://\u003cPAT\u003e@github.com/\u003caccount\u003e/\u003crepo\u003e.git\n```\nexample\n```bash\n# check\ngit remote -v\nPAT=...\ngit remote add origin https://$PAT@github.com/pyfunc/lib.git\n# OR update:\ngit remote set-url origin https://$PAT@github.com/pyfunc/lib.git\n# check\ngit remote -v\ngit push\n```\n\nFollow-up with the classic git branch -M main and git push -u origin main\n\nThat worked for me. Hopefully for you too.\n\n## pypi publishing\n\n[Creating a PyPI Project with a Trusted Publisher - PyPI Docs](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)\n\n\n\n## Creating tags from the command line\n\nTo create a tag on your current branch, run this:\n```bash\ngit tag \u003ctagname\u003e\n```\n\nIf you want to include a description with your tag, add -a to create an annotated tag:\n```bash\ngit tag \u003ctagname\u003e -a\n```\n\nThis will create a local tag with the current state of the branch you are on. \nWhen pushing to your remote repo, tags are NOT included by default. \nYou will need to explicitly say that you want to push your tags to your remote repo:\n```bash\ngit push origin --tags\n```\n\nexample:\n\n```bash\ngit tag 0.1.12\ngit push origin --tags\n```\n\n\n\n## test\n\n```bash\npip install build\npip install build hatchling\n```\n\n\n```bash\npy -m build\n```\n\n\n\n\n\n## init\n\nThe `__init__.py` file is used to mark a directory as a Python package and can also be used to initialize code, define the package's public API, and handle package-level variables or imports.\n\nHere’s a basic guide on preparing the `__init__.py` file for your project located in the `src/pyfunc2/` directory.\n\n### Basic `__init__.py`\n\n1. **Creating the `__init__.py` File**:\n   - Navigate to `src/pyfunc2/` directory.\n   - Create an `__init__.py` file in this directory.\n\nHere is a basic example of what this file might contain:\n\n\n\n### Ensuring Proper Package Structure\n\nHere's what your final project structure might look like:\n\n```\nmy_project/\n├── src/\n│   └── pyfunc2/\n│       ├── __init__.py\n│       ├── module1.py\n│       └── module2.py\n├── pyproject.toml\n├── README.md\n└── requirements.txt\n```\n\n\n\n\n\n\n\nHoe generate an `__init__.py` file automatically based on information in `pyproject.toml` typically\n\nLet's break down how you can achieve this:\n\n1. **Understand the data to be included in `__init__.py`**: Essentially, you might want to include metadata (like version), and possibly auto-imports of modules/classes/functions.\n\n2. **Create a script to generate `__init__.py`**: This script would read `pyproject.toml`, extract the relevant information, and generate the `__init__.py` file.\n\n### Step-by-Step Guide\n\n#### Step 1: Install Required Libraries\n\nYou will need `toml` for parsing `pyproject.toml`. Install it using `pip`.\n\n```bash\npip install toml\n```\n\n#### Step 2: generate_init.py\n\nCreate a Python script, e.g., `generate_init.py`, at the root of your project:\n\nEnsure that your `generate_init.py` script runs as part of your build process in your GitHub Actions workflow.\n\nHere's an updated GitHub Actions workflow to include the script execution:\n\n```bash\npy generate_init.py -p src/pyfunc2\npy generate_init.py -p src/pyfunc2/config\npy generate_init.py -p src/pyfunc2/csv\npy generate_init.py -p src/pyfunc2/email\npy generate_init.py -p src/pyfunc2/file\npy generate_init.py -p src/pyfunc2/function\npy generate_init.py -p src/pyfunc2/github\npy generate_init.py -p src/pyfunc2/local\npy generate_init.py -p src/pyfunc2/markdown\npy generate_init.py -p src/pyfunc2/ml\npy generate_init.py -p src/pyfunc2/ocr\npy generate_init.py -p src/pyfunc2/report\npy generate_init.py -p src/pyfunc2/serialization\npy generate_init.py -p src/pyfunc2/text\n\n```\n\n```bash\npy -m build\n```\n```bash\npy -m incremental.update pyfunc2 --newversion=0.1.18\npy -m incremental.update pyfunc2 --create\npy -m incremental.update pyfunc2 --patch\n\npy -m incremental.update pyfunc2 --rc\npy -m incremental.update pyfunc2\n```\n\n```bash\npip install dist/pyfunc2-0.1.15-py3-none-any.whl\n```\n\n\n## validate pyproject.toml\n\n```bash\npip install 'validate-pyproject[all]'\n```\n\n\n```bash\nvalidate-pyproject pyproject.toml\n```\n\n\n\n## Quick Start\n\n### Local Development\n1. Create virtual environment\n```bash\nrm -rf venv\npython -m venv venv\nsource venv/bin/activate\npip install --upgrade pip\npip install -r requirements.txt\n```\n\nI see a persistent issue with your package publication process. Let me help you resolve these problems:\n\n1. Version Detection Problem\nThe error messages show that the version is not being correctly detected:\n```\n❌ Could not find version in src/pyfunc2/__init__.py\n❌ Could not find version in ./src/pyfunc2/_version.py\n❌ Could not find version in ./pyproject.toml\n```\n\n2. License Classifier Issue\nThere's an ongoing problem with the license classifier in the `pyproject.toml`.\n\n1. Replace your existing `pyproject.toml` with the new version\n2. Create `src/pyfunc2/_version.py` with the content I provided\n3. Remove any existing `setup.py` if it exists\n4. Use `python -m build` to create distribution\n5. Use `twine upload dist/*` to publish\n\nRecommended workflow:\n```bash\n# Ensure you're in your project root\npython -m pip install --upgrade build twine\npython -m build\npython -m twine upload dist/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyfunc%2Flib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyfunc%2Flib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyfunc%2Flib/lists"}