PyProjectLib
Description
Python package for managing local python projects and repositories
Install
pip install pyprojectlib
Usage
Command Line Usage: "ppl"
usage: ppl [-h] {new,push,pack} ...
Package for managing local python projects and repositories
positional arguments:
- {new,push,pack} Command to execute (options below)
- new Create a new repo, project, or user of a repo
- push Save your python project in a local repository
- pack Package python project into a distributable module
Command Line Usage: "ppl">"new"
usage: ppl new [-h] {repo,proj,user} ...
positional arguments:
- {repo,proj,user} Create something (options below)
- repo Create a new empty repository
- proj Create a new empty project
- user Add a new user to a local repository
Command Line Usage: "ppl">"new">"repo"
usage: ppl new repo repopath [-h] [-name NAME] [-email EMAIL] [-gituser GITUSER]
positional arguments:
- repopath Path to local python repository. Directory name = repo name.
options:
- -name NAME, -n NAME Your full name
- -email EMAIL, -e EMAIL Your email address
- -gituser GITUSER, -g GITUSER Your username on Github
Command Line Usage: "ppl">"new">"project"
usage: ppl new proj projpath [-h]
positional arguments:
- projpath Path to python project. Directory name = project name.
Command Line Usage: "ppl">"new">"user"
usage: ppl new user repopath [-h] [-name NAME] [-email EMAIL] [-gituser GITUSER]
positional arguments:
- repopath Path to local python repository. Directory name = repo name.
options:
- -name NAME, -n NAME Your full name
- -email EMAIL, -e EMAIL Your email address
- -gituser GITUSER, -g GITUSER Your username on Github
Command Line Usage: "ppl">"push"
usage: ppl push repopath projpath [-h] [-relpath RELPATH] [-noclean] [-nodoc] [-notest] [-version VERSION] [-name NAME] [-email EMAIL] [-gituser GITUSER]
positional arguments:
- repopath Path to local python repository. Directory name = repo name.
- projpath Path to python project. Directory name = project name.
options:
- -relpath RELPATH, -r RELPATH Relative path from repository basedir to add project
- -noclean, -nc Flag to prevent checking py files for cleanliness
- -nodoc, -nd Flag to prevent html documentation creation
- -notest, -nt Flag to prevent pytest from running
- -version VERSION, -v VERSION Version number of python project (X.Y.Z)
- -name NAME, -n NAME Your full name
- -email EMAIL, -e EMAIL Your email address
- -gituser GITUSER, -g GITUSER Your username on Github
Command Line Usage: "ppl">"pack"
usage: ppl pack projpath [-h] [-upload] [-install] [-version VERSION] [-name NAME] [-email EMAIL] [-gituser GITUSER] [-pyversion PYTHONVERSION]
positional arguments:
- projpath Path to python project. Directory name = project name.
options:
- -upload, -u Flag to upload python module to PYPI after packaging it
- -install, -i Flag to install python module after packaging it
- -version VERSION, -v VERSION Version number of python project (X.Y.Z)
- -name NAME, -n NAME Your full name
- -email EMAIL, -e EMAIL Your email address
- -gituser GITUSER, -g GITUSER Your username on Github
- -pyversion PYVERSION, -p PYVERSION Minimum version of Python required
- -filetypes FILETYPES, -t FILETYPES Comma-seperated list of file types to include
Python In-Line Usage
- Example below can be ran as a standalone code example
- Example includes standard Python packages shutil, os, and sys
- In-line usage of pypackagelib is shown when calling "ppl."
from os import path
import sys
from shutil import rmtree, copytree
from pyprojectlib.pyuser import User # type: ignore # pylint: disable=E0401,C0413
from pyprojectlib.pyrepo import Repository # type: ignore # pylint: disable=E0401,C0413
import pyprojectlib as ppl # type: ignore # pylint: disable=E0401,C0413,E0611
def test_setup_pyproject():
"""function for testing setup_pyproject"""
version = "0.0.1"
pkgpath = path.join(testdir, "../")
initpath = path.join(testdir, "../../testproj1")
initpathcopy = path.join(testdir, "examples", "testproj1")
repopath1 = path.join(testdir, "../../testrepo1")
repopathcopy1 = path.join(testdir, "./examples/testrepo1")
repopath2 = path.join(testdir, "../../testrepo2")
repopathcopy2 = path.join(testdir, "./examples/testrepo2")
# Delete old tests
deletelist = [
initpath,
initpathcopy,
repopath1,
repopathcopy1,
repopath2,
repopathcopy2,
]
for dirpath in deletelist:
if path.exists(dirpath):
rmtree(dirpath)
# create new project
ppl.init_project(initpath)
# create a user object
userargs = {
"name": "Jason Krist",
"email": "jkrist2696@gmail.com",
"gituser": "jkrist2696",
}
user = User(**userargs)
# Create new repo and push this package
ppl.init_repo(repopath1, **userargs)
repo = Repository(repopath1, user)
repo.push(pkgpath, version=version, test=False, relpath="python/generic")
# Create a second repo and push this package
ppl.init_repo(repopath2, **userargs)
repo = Repository(repopath2, user)
repo.push(pkgpath, version=version, test=False, relpath=".")
# push again to act as new version
repo.push(pkgpath, test=False)
# Move all to examples folder
copytree(initpath, initpathcopy)
rmtree(initpath)
copytree(repopath1, repopathcopy1)
rmtree(repopath1)
copytree(repopath2, repopathcopy2)
rmtree(repopath2)
# package this project
ppl.Log.package_project(pkgpath, user)
if __name__ == "__main__":
test_setup_pyproject()
Read The Docs
Download "docs" folder or check preview.
Contributing
Message me on Github.
License
Copyright:
(c) 2023, Jason Krist
Metadata
Release files for pyprojectlib 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyprojectlib-0.0.8.tar.gz | 42.0 kB | Without provenance | Details for pyprojectlib-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyprojectlib-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for pyprojectlib-0.0.8-py3-none-any.whl |
Total release size: 85.9 kB
Release files / pyprojectlib-0.0.8.tar.gz
| Download URL | pyprojectlib-0.0.8.tar.gz |
|---|---|
| Size | 42.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bd8f5fe7c1f206142818c40c65f9fae93761c2daf2ad70c82c0f55827b1744f
|
|
BLAKE2b-256 checksum How to use checksums |
fe1f6c99ac783d1d8eff1ee8dd7c65e24f837cc82c6c4a3a57660da683b026b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / pyprojectlib-0.0.8-py3-none-any.whl
| Download URL | pyprojectlib-0.0.8-py3-none-any.whl |
|---|---|
| Size | 44.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b3fedb1a7f0669ed6b324b758e6f228d9261787e3a7eeaa65351e0243fb2248
|
|
BLAKE2b-256 checksum How to use checksums |
50775efdb7fad08cd8eb53918a21eb844120383c434a93e29b2ad13ac7ca2626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for pyprojectlib 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.