Skip to main content

✨ ArtinKit

ArtinKit — Lightweight Python Toolkit

Small tools. Cleaner code. Fewer dependencies.
A practical, lightweight Python toolkit for everyday development.

PyPI version Supported Python versions MIT License CI status

ArtinKit is a reusable collection of small Python utilities for common development tasks: text processing, filesystem operations, JSON storage, input checks, logging, and command-line helpers.

The goal is simple: make everyday tasks easier without forcing a large framework or a long list of dependencies into your project. ArtinKit is designed for scripts, learning projects, prototypes, desktop utilities, and Python applications that benefit from small, explicit helper functions.

  • Lightweight by design: the runtime package uses Python's standard library.
  • Straightforward APIs: small functions with familiar Python types.
  • Unicode-aware JSON: preserve Persian and other non-ASCII characters when storing JSON.
  • Command-line helpers: run simple tasks directly from a terminal.
  • Open source: distributed under the MIT License.

📚 Table of contents

🚀 Get started

Install from PyPI

The simplest installation command is:

pip install ArtinKit

If your computer has multiple Python installations, or you want to ensure that pip is associated with the Python interpreter you intend to use, prefer:

python -m pip install ArtinKit

On many Windows systems, this form is also convenient:

py -m pip install ArtinKit

Upgrade an existing installation:

python -m pip install --upgrade ArtinKit

Check package information after installation:

python -m pip show ArtinKit

Package name: ArtinKit
Python import name: artinkit
Python requirement: 3.10 or newer
Runtime dependencies: no mandatory third-party dependencies

🌟 Features

Component Capabilities Typical use
artinkit.text Whitespace normalization, word counting, truncation, slug creation, line counting, blank checks, prefix/suffix removal Clean and transform text predictably
artinkit.files UTF-8 text reading/writing, directory creation, file listing, file-size inspection Small scripts, local tools, configuration files
artinkit.jsonstore Read and write JSON with Unicode preserved Settings files, lightweight local data, simple preferences
artinkit.validation Check non-empty strings, integer values, finite numbers, and regex matches Preliminary input checks before application-specific logic
artinkit.get_logger Obtain a named standard-library logger Organize log messages in scripts and applications
artinkit command Normalize text, inspect a file, or calculate a file SHA-256 digest Quick tasks without writing a separate script

What makes it useful?

  • No required runtime add-ons: the package's ordinary use does not require third-party runtime libraries.
  • Small, focused utilities: use only the functions you need instead of adopting a large framework.
  • Python-standard interfaces: work with familiar strings, paths, dictionaries, lists, and numbers.
  • Persian and Unicode-friendly JSON: JSON output uses UTF-8 and preserves non-ASCII text.
  • Explicit file operations: the caller chooses the path and whether missing parent directories should be created.
  • Terminal-friendly: common supported tasks can be run using the installed CLI.
  • Developer workflow: the repository includes tests and GitHub Actions workflows for checking code and built distributions.

ArtinKit is intentionally a small utility toolkit rather than an all-in-one framework. Its current features are listed above; integrations and capabilities not described here should not be assumed to exist.

📦 Installation

Standard installation

python -m pip install ArtinKit

Installation in a virtual environment

A virtual environment helps keep project dependencies separate from other Python projects.

Create one:

python -m venv .venv

Activate it on Windows Command Prompt:

.venv\Scripts\activate

Activate it on Windows PowerShell:

.venv\Scripts\Activate.ps1

Activate it on macOS or Linux:

source .venv/bin/activate

Then install ArtinKit:

python -m pip install ArtinKit

Verify installation

python -c "import artinkit; print('ArtinKit', artinkit.__version__)"

If your terminal says that artinkit cannot be imported, confirm that the installation succeeded and that your application is using the same Python environment.

💻 Quick start

This example uses text, JSON, and file helpers together:

from artinkit import files, jsonstore, text

# Normalize a message.
message = text.normalize_whitespace("  Hello    from   ArtinKit!  ")
print(message)
# Hello from ArtinKit!

# Write a UTF-8 text file. Missing parent directories are created.
files.write_text(
    "example-output/hello.txt",
    "Hello from ArtinKit",
    create_parents=True,
)

# Store a small settings object as JSON.
settings = {
    "language": "fa",
    "message": "سلام از آرتین‌کیت",
    "enabled": True,
}
jsonstore.save_json(
    "example-output/settings.json",
    settings,
    create_parents=True,
)

# Read the JSON file back.
loaded = jsonstore.load_json("example-output/settings.json")
print(loaded["message"])

The paths in this example are relative to the directory from which you run the script. Change them to paths appropriate for your application.

✍️ Text utilities

Import the text module:

from artinkit import text

Normalize whitespace

Collapse repeated whitespace and remove whitespace at the beginning and end:

text.normalize_whitespace("  one   two\nthree  ")
# 'one two three'

Count words

Count whitespace-separated items:

text.word_count("ArtinKit makes small tasks simpler")
# 5

This is a simple whitespace-based count, not a linguistic tokenizer. Languages and texts that require advanced word segmentation may need a specialized tool.

Truncate text

Limit a string to a maximum number of characters, including the suffix when it fits:

text.truncate("A longer message for a preview", 18)
# 'A longer messag...'

The maximum length must be a non-negative integer. If the text is already short enough, it is returned unchanged.

Create a simple slug

text.slugify("ArtinKit Utility Tools")
# 'artinkit-utility-tools'

The current slug helper creates a basic lowercase ASCII slug. It is suitable for simple English-oriented labels; it does not transliterate Persian text into Latin characters.

📁 File utilities

Import the filesystem helpers:

from artinkit import files

Read UTF-8 text:

content = files.read_text("notes.txt")

Write text and optionally create parent directories:

files.write_text(
    "output/reports/summary.txt",
    "Report complete",
    create_parents=True,
)

Create a directory:

directory = files.ensure_dir("output/reports")

List files in a directory:

items = files.list_files("output")
for item in items:
    print(item)

List files recursively:

all_files = files.list_files("output", recursive=True)

Get a file's size in bytes:

size = files.file_size("output/reports/summary.txt")
print(f"{size} bytes")

File-operation behavior

  • Text is read and written as UTF-8 by default.
  • Parent directories are created only when you explicitly pass create_parents=True to the supported write helper.
  • list_files() expects an existing directory.
  • file_size() expects an existing regular file.
  • The caller is responsible for selecting a suitable path and handling expected filesystem errors.

These helpers are not a filesystem sandbox and should not be given untrusted paths without appropriate validation and permission controls.

🗃️ JSON storage

ArtinKit's JSON helpers use Python's built-in json module and UTF-8 text files.

from artinkit import jsonstore

profile = {
    "name": "Example",
    "language": "fa",
    "welcome": "سلام!",
    "notifications": True,
}

jsonstore.save_json("settings.json", profile, indent=2)
loaded_profile = jsonstore.load_json("settings.json")

print(loaded_profile["welcome"])
# سلام!

To create parent directories automatically:

jsonstore.save_json(
    "data/preferences.json",
    {"theme": "dark"},
    create_parents=True,
)

JSON notes

  • Non-ASCII characters are preserved instead of being forced into escaped Unicode sequences.
  • The output is UTF-8 text and ends with a newline.
  • Non-finite JSON numbers such as NaN and infinity are rejected during saving.
  • Invalid JSON and missing files raise normal Python exceptions, so applications can handle them with try/except.
  • JSON is a data format, not a database engine. Use a database when you need concurrent writes, transactions, indexing, or more advanced data management.

Example error handling:

import json
from artinkit import jsonstore

try:
    settings = jsonstore.load_json("settings.json")
except FileNotFoundError:
    settings = {}
except json.JSONDecodeError:
    settings = {}

Choose an appropriate recovery strategy for your application; silently replacing invalid configuration may not be suitable for every use case.

✅ Validation helpers

The validation module provides small checks for common values:

from artinkit import validation

print(validation.is_non_empty_string("hello"))  # True
print(validation.is_non_empty_string("   "))     # False

print(validation.is_integer(10))                 # True
print(validation.is_integer(True))               # False

print(validation.is_finite_number(3.14))         # True
print(validation.is_finite_number(float("inf"))) # False

print(validation.matches_pattern("ABC-123", r"[A-Z]{3}-\d{3}"))  # True

These functions help with basic checks. They do not automatically validate a full business rule, sanitize HTML, prevent SQL injection, validate every possible email address, or replace domain-specific security controls. Add the checks your application actually requires.

🪵 Logging

ArtinKit exposes a helper for obtaining a named standard-library logger:

import logging
from artinkit import get_logger

logger = get_logger("my_application")
logger.setLevel(logging.INFO)

# Configure handlers in your application as appropriate.
logger.info("Application started")
logger.warning("This is a sample warning")

The helper does not configure the root logger or add output handlers for you. Applications can choose their own log format, destination, and level.

⌨️ Command-line interface

ArtinKit installs an artinkit command.

Normalize text

artinkit normalize "  Hello    world  "

Expected output:

Hello world

Inspect a file

artinkit file-info README.md

The command displays the path and size of an existing file. These commands are intentionally small utilities, not a general-purpose shell or file manager.

If the command is unavailable, first check that the package was installed into the active environment. You can also use:

python -m pip show ArtinKit

📴 Offline installation on Windows

ArtinKit can be installed on a computer that has no internet connection if you transfer the built wheel file to it. The target computer still needs a compatible Python installation.

  1. On a computer with internet access, open the ArtinKit files page on PyPI.
  2. Download the wheel for the desired published version.
  3. Transfer the wheel to the offline computer using an approved method.
  4. Open Command Prompt in the folder containing the wheel.
  5. Install it with pip's package-index access disabled.

For version 0.1.0, the wheel is named:

artinkit-0.1.0-py3-none-any.whl

Run:

py -m pip install --no-index --no-deps artinkit-0.1.0-py3-none-any.whl

Verify it:

py -c "import artinkit; print(artinkit.__version__)"

The --no-index option prevents pip from querying package indexes. The --no-deps option skips dependency installation; this is appropriate because the package has no mandatory third-party runtime dependencies.

Important: this wheel installs ArtinKit, not Python. Python 3.10 or newer must already be installed. For more detail, see OFFLINE_INSTALL.md.

🔐 Security and responsible use

ArtinKit is intentionally small, but no utility library can make every calling application secure automatically.

  • Network behavior: the documented core helpers do not need to contact a remote service to perform their local text, file, JSON, validation, or logging tasks.
  • JSON: JSON is parsed as data; loading a JSON file does not execute it as Python code. Still, validate the contents before trusting them.
  • Filesystem access: file helpers use paths supplied by the caller. They do not create a security boundary or prevent access to sensitive files.
  • Untrusted input: validate and constrain user-provided values before using them in paths, configuration, or application logic.
  • Permissions: run applications with only the filesystem and system permissions they need.
  • Secrets: never commit passwords, access tokens, private keys, personal information, or confidential configuration to the repository.
  • Dependencies: keep build and development dependencies separate from runtime dependencies and review tool output before publishing.
  • Security reports: report potential vulnerabilities privately to the repository owner rather than publishing sensitive exploit details in a public issue.

The project uses automated checks in its development workflow, but passing a scanner or test suite is not a guarantee that software is free of defects. Review the code and test it in the context where you plan to use it.

🔐 Security utilities\n\nArtinKit includes small helpers built on Python's standard library:\n\npython\nfrom artinkit import security\n\n# Hash text or a file for integrity checks.\ntext_digest = security.sha256_text("سلام")\nfile_digest = security.sha256_file("archive.zip")\n\n# Generate a random URL-safe token (at least 16 bytes of entropy requested).\ntoken = security.generate_token()\n\n# Compare secret-like strings without ordinary early-exit equality.\nvalid = security.constant_time_compare(provided_token, expected_token)\n\n\nSHA-256 is a hash, not encryption. A file digest can help detect changes only when the expected digest is obtained through a trusted channel. constant_time_compare does not make the surrounding application automatically secure, and generated tokens should still be stored and handled carefully.\n\nUse the CLI to hash a file:\n\nbash\nartinkit hash-file path/to/file.zip\n\n\n## 🧰 Compatibility and dependencies

  • Python: 3.10 or newer.
  • Implementation: pure Python.
  • Required runtime dependencies: none beyond Python's standard library.
  • Operating systems: intended for platforms supported by the declared Python versions; filesystem paths and command examples may behave differently across operating systems.
  • Development tools: installed separately through the optional dev extra.

No AI model, API key, external service, or background service is required for the documented core features.

🧪 Development and quality checks

To work on the project from a local clone, use a supported Python interpreter.

Install the package in editable mode with its development tools:

python -m pip install -e ".[dev]"

Run the test suite:

python -m pytest

Run the static security scan:

python -m bandit -q -r src

Build the source distribution and wheel:

python -m build

Validate the distribution metadata:

python -m twine check dist/*

The optional dev extra installs tools used for development and release checks; it is not needed by ordinary users of the library.

GitHub Actions workflows are configured for tests, security scanning, build checks, and package validation. View the Actions page to inspect actual workflow results. A workflow badge is a live status indicator, not a substitute for reviewing the logs.

🗂️ Project structure

ArtinKit/
├── .github/workflows/    # Continuous integration and publishing workflows
├── src/artinkit/         # Library source code and CLI\n│   └── security.py       # Hashing and token helpers
├── tests/                # Automated tests
├── CHANGELOG.md          # Project change history
├── OFFLINE_INSTALL.md    # Offline installation guide
├── LICENSE               # MIT license text
├── pyproject.toml        # Build configuration and package metadata
└── README.md             # Project guide and examples

🧭 Roadmap ideas

Possible future directions for the project may include additional focused utilities, expanded examples, more cross-platform tests, and improved documentation. These are ideas rather than promises or existing features. Check the issue tracker for current discussion and planned work.

🐛 Troubleshooting

Problem: No module named 'artinkit'

  • Confirm that installation completed successfully.
  • Install using the same interpreter that runs the script: python -m pip install ArtinKit.
  • If using a virtual environment, activate it before installing and running the code.

Problem: artinkit command is not found

  • Check that the package is installed in the active environment.
  • Reopen the terminal after installation if necessary.
  • Run the command in the same environment where you installed the package.

Problem: file not found

  • Relative paths are resolved from the process's current working directory, which may differ from the directory containing your Python script.
  • Confirm that the file exists at the path you passed.

Problem: invalid JSON

  • Confirm that the file contains valid JSON syntax.
  • Handle json.JSONDecodeError if the file may be edited or supplied externally.

🤝 Contributing

Bug reports, documentation corrections, and practical feature suggestions are welcome through GitHub Issues.

When filing an issue, please include:

  • The Python version and operating system.
  • The ArtinKit version you installed.
  • A minimal example that reproduces the issue.
  • The error message or traceback, with private paths or personal information removed where appropriate.

Do not include passwords, access tokens, private keys, personal data, or confidential files in a public issue. Keep reports focused and reproducible.

📜 License

ArtinKit is distributed under the MIT License. You may use, modify, and distribute it according to the terms in that license.


ArtinKit — practical Python helpers, with a small footprint.
PyPI · GitHub · Issues

Metadata

Release files for ArtinKit 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ArtinKit 0.1.1
File Size Uploaded Provenance
artinkit-0.1.1.tar.gz 22.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ArtinKit 0.1.1
File Interpreter ABI Platform
artinkit-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / artinkit-0.1.1.tar.gz

Download URL artinkit-0.1.1.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
daf66c40bce37e22217321554f90c3901116adf256c33a63964a6863e19a32bf
BLAKE2b-256 checksum
How to use checksums
5ab369bfd13b2263de167297368b813398bf82a0d2172911332aabb6e3eccaa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / artinkit-0.1.1-py3-none-any.whl

Download URL artinkit-0.1.1-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
136de8e8de0ad8096931d20c2bf85f236bd1e9d5a75e82dacb1eb7916b35dada
BLAKE2b-256 checksum
How to use checksums
28f29eeb06e2fe26731fc9cda8af4f09f129e03f701b5f7541278eabe6e38297
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for ArtinKit 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for artinkit-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page