Skip to main content

No project description provided

Project description

nerdcore

Python framework for building CLI tools with commands, deployments, and entity management.

nerdcore provides the runtime, discovery, and utilities. Projects like nerdcli provide the actual command implementations.

Installation

# Editable install (development)
pip install -e ~/local-git/nerdcore

# Package install
pip install nerdcore

Concepts

Commands

Single-operation tools. Inherit from Command, declare arguments as class attributes, implement run().

from nerdcore.base_entities.command_class import Command

class MyCommand(Command):
    required_arg_keys = ['name']
    name: str = None

    def run(self):
        print(f"Hello, {self.name}")

Deployments

Multi-step orchestrations with config profile support. Inherit from Deployment.

from nerdcore.base_entities.deployment_class import Deployment

class MyDeploy(Deployment):
    app_name = 'myapp'
    required_config_keys = ['DEPLOY_TYPE']

    def run(self):
        # self.nerd_config has the loaded profile
        ...

Entity Discovery

Entities are Python files in commands/ and deployments/ directories. nerdcore discovers them by filename using fuzzy matching (Levenshtein distance). Running nerd deploy-lead finds deployments/deploy-lead.py.

Configuration

  • NerdConfig: Singleton loaded from config/nerd-manifest.yaml. Profiles define deployment parameters.
  • ENV: Environment variables loaded from .env via a project-specific env class.

Error Handling

  • NerdUserError — user-facing errors (bad input, missing config). Clean message, no traceback.
  • NerdError — internal errors. Message + traceback.

Both are defined in nerdcore.errors (import-free module to prevent circular dependencies).

Creating a New Project

nerd-new my-project

This scaffolds the standard directory structure:

my-project/
├── abilities/
├── commands/
├── config/
│   └── framework/
├── deployments/
├── tasks/
├── stor/temp/
├── .env
├── .gitignore
├── requirements.txt
└── README.md

Entry Points

nerdcore registers three console_scripts via setup.py entry_points:

Command Entry Point
nerd nerdcore.cli.main:main
nerd-new nerdcore.cli.nerd_new:main
nerdcore nerdcore.__main__:main

Publishing

bump2version patch    # or minor, major
git push && git push --tags
# Triggers CI pipeline for PyPI publishing

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

nerdcore-1.0.0.tar.gz (31.4 kB view details)

Uploaded Source

File details

Details for the file nerdcore-1.0.0.tar.gz.

File metadata

  • Download URL: nerdcore-1.0.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for nerdcore-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b84a51e74af2852fcb48497769894d7203cc964bc54f40c5c7d43ebf0a32910e
MD5 47a0faf4d492f29feb974bca4cd610a2
BLAKE2b-256 e4fea4e4eacb1ec47e3271f6625f98bc4d3d8ec75ec657c5ad39fc1a6702813c

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