Skip to main content

Encryptcode tool to encrypt python files

Project description

This respository is to build any python package and push it ot PyPI repository

Procedure (Detailed):

1. Project Structure

Organize your project like this:

your_project/
│
├── src/your_package/          # Your actual Python code
│   ├── __init__.py
│   ├── module1.py
│   └── module2.py
│
├── tests/                     # Optional tests
│   └── test_module1.py
│
├── pyproject.toml             # Modern way to declare build system
├── setup.cfg                  # Metadata & configs
├── README.md                  # Description (shown on PyPI)
├── LICENSE                    # License (MIT, Apache2, etc.)
└── MANIFEST.in                # (optional) include non-Python files

2. pyproject.toml

This tells pip how to build your package. Example:

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "your-package-name"         # must be unique on PyPI
version = "0.1.0"
description = "A short description of your package"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
  {name = "Your Name", email = "you@example.com"}
]
dependencies = [
  "requests>=2.0",
]

[project.urls]
Homepage = "https://github.com/yourusername/your_project"

3. setup.cfg (optional, metadata in pyproject.toml is enough, but you can split)

[metadata]
name = your-package-name
version = 0.1.0
author = Your Name
author_email = you@example.com
description = A short description
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/yourusername/your_project
license = MIT

[options]
package_dir =
    = src
packages = find:
python_requires = >=3.8

[options.packages.find]
where = src

4. Build the Package

First install the tools:

pip install build twine

Then build your distribution:

python -m build

This creates:

dist/
  your_package_name-0.1.0.tar.gz
  your_package_name-0.1.0-py3-none-any.whl

5. Install Locally (test before uploading)

pip install dist/your_package_name-0.1.0-py3-none-any.whl

or for development mode:

pip install -e .

6. Upload to PyPI

Create a PyPI account: https://pypi.org/account/register/

Upload with Twine:

python -m twine upload dist/*

If you want to test before real PyPI, use TestPyPI:

python -m twine upload --repository testpypi dist/*

✅ Now your module is pip install your-package-name ready!

Procedure (Simplified):

🔹 1. Install Required Tools

Make sure you have the build & upload tools installed:

pip install build twine

🔹 2. Build Your Package

From your project root (where pyproject.toml / setup.cfg lives):

python -m build


This creates a dist/ folder with files like:

dist/
  your_package-0.1.0-py3-none-any.whl
  your_package-0.1.0.tar.gz

🔹 3. Upload With Twine

Upload to PyPI (public)

twine upload dist/*

Upload to TestPyPI (sandbox)

twine upload --repository testpypi dist/*

🔹 4. Authentication

The first time, Twine will ask for your PyPI username and password. Best practice now is to use API tokens instead of your account password.

Go to your PyPI account → Account settings → API tokens.

Create a token with scope “Entire account” (or project-specific).

Copy the token (looks like pypi-AgENdGVzdC5weXBpLm9yZw...).

Then use it when prompted:

username = __token__

password = <your-api-token>

🔹 5. Store Credentials Securely (Optional)

Instead of typing credentials every time, you can set them up in ~/.pypirc:

[pypi]
  username = __token__
  password = pypi-AgENdGVzd...

[testpypi]
  repository = https://test.pypi.org/legacy/
  username = __token__
  password = pypi-AgENdGVzd...

Now you can upload with:

twine upload -r pypi dist/*

or

twine upload -r testpypi dist/*

🔹 6. Verify Upload

After a successful upload:

PyPI: https://pypi.org/project/your-package-name/
TestPyPI: https://test.pypi.org/project/your-package-name/

Users can then install:

pip install your-package-name

or from TestPyPI:

pip install --index-url https://test.pypi.org/simple/ your-package-name

✅ That’s the complete flow: build → upload with twine → authenticate → verify.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encryptcode-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

encryptcode-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file encryptcode-0.1.0.tar.gz.

File metadata

  • Download URL: encryptcode-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for encryptcode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04fd3c9a7eb88269b90dcae3d13ebd5eb9a8beb32cf15dcba332b9997ef1fed9
MD5 2955f25774e6910887533cbcc83ba93a
BLAKE2b-256 9f050727aee7bee7bc15f45977bd4359650f9e2a7b844fe141bc6539113f498a

See more details on using hashes here.

File details

Details for the file encryptcode-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: encryptcode-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for encryptcode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cfafbc8a364ee1537ca8a0324d977380c5113236369c4b919ba357550f65df4
MD5 da4dbeeae22ad2c3b12df4b12a14b31f
BLAKE2b-256 80604ff7cbc6ff3a51e781e557e17b28b6ed86d468d376c2c9b1a7c4824f125a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page