Skip to main content

Neuronic - AI-powered data transformation library

Project description

Neuronic 🧠

Neuronic Logo

Imagine Python functions that can think, reason, and create - functions that understand natural language, analyze complex data patterns, and generate creative solutions. Welcome to Neuronic - where we transform ordinary Python code into intelligent, AI-powered modules that bring GPT's cognitive capabilities directly into your codebase, complete with enterprise-grade validation, caching, and error handling.

✨ Magic in Three Lines

from neuronic import Neuronic

@neuronic.function(output_type="json")
def convert_to_vegetarian(recipe: str) -> dict:
    """Convert any food recipe to its vegetarian version while maintaining the flavor profile."""
    pass

# That's it! Your function is now AI-powered 🌱
veggie_recipe = convert_to_vegetarian("Classic Beef Burger with bacon")

🌟 What is Neuronic?

Neuronic is your gateway to building intelligent Python applications powered by GPT-4o. Create functions that can understand context, extract insights, and solve complex problems - all while maintaining the reliability and predictability of traditional programming. With built-in validation, type checking, and caching, Neuronic makes AI as dependable as any other Python module.

🚀 Features

  • 🎯 Smart Function Decorator: Transform any Python function into an AI-powered one with a simple decorator
  • 🧠 Intelligent Understanding: Create functions that truly understand your data, extracting meaning and insights
  • 🗣️ Natural Language Processing: Process text like a human - analyze sentiment, extract key information, and understand context
  • ✍️ Creative Generation: Generate human-quality content, from documentation to test data, tailored to your specifications
  • 🔍 Pattern Recognition: Uncover hidden patterns and relationships in your data through GPT-powered analysis
  • 📦 Multiple Output Types: Get results in any format you need - strings, numbers, JSON, lists, booleans, or Python structures
  • 🏢 Enterprise Ready: Built-in validation, type checking, and caching ensure production-ready outputs
  • ⚡ Performance Optimized: Automatic chunking for large inputs and smart caching for repeated operations

🛠️ Quick Start

Installation

pip install neuronic

Configuration

# Option 1: Use environment variables (.env file)
OPENAI_API_KEY=your-openai-api-key-here

# Option 2: Pass API key directly
neuronic = Neuronic(api_key="your-api-key-here")

🎮 Cool Examples

🪄 Smart Function Decorator

Transform any Python function into an AI-powered one:

@neuronic.function(output_type="string")
def generate_mini_story(character: str, setting: str, mood: str) -> str:
    """Create a three-sentence story based on the given character, setting, and mood."""
    pass

story = generate_mini_story(
    character="a curious robot",
    setting="ancient library",
    mood="mysterious"
)

🧹 Smart Data Cleaning

Clean and standardize messy data:

@neuronic.function(output_type="json")
def clean_user_data(users: List[Dict]) -> List[Dict]:
    """
    Clean and standardize user data:
    - Properly capitalize names
    - Validate and fix email addresses
    - Convert age to numbers
    """
    pass

clean_data = clean_user_data(messy_data)

🎨 Creative Generation

Generate emoji-based character profiles:

emoji_personas = neuronic.generate(
    spec="""Create unique emoji-based character profiles with:
    - Emoji combination for appearance
    - Personality trait
    - Favorite hobby
    - Life motto""",
    n=3
)

📊 Smart Analysis

Analyze text with context and reasoning:

analysis = neuronic.analyze(
    data=movie_review,
    question="What aspects of the movie did the reviewer focus on?"
)
print(f"Answer: {analysis['answer']}")
print(f"Confidence: {analysis['confidence']}")
print(f"Reasoning: {analysis['reasoning']}")

🎯 Perfect For

  • 🔄 Data Processing: Format conversion, cleaning, normalization
  • 📝 Content Creation: Documentation, test data, sample content
  • 📊 Analysis: Pattern recognition, sentiment analysis, trend detection
  • 🛠️ Development: Code transformation, API handling, validation

🧰 API Reference

Core Methods

# Transform data
result = neuronic.transform(
    data=input_data,               # What to transform
    instruction="your instruction", # How to transform it
    output_type="string",          # What format you want
    example=None,                  # Optional example
    context=None                   # Optional context
)

# Analyze data
insights = neuronic.analyze(
    data=your_data,      # What to analyze
    question="your question"  # What to find out
)

# Generate data
new_data = neuronic.generate(
    spec="what to generate",  # What you want
    n=1                      # How many items
)

🎓 Best Practices

  1. 🔐 Security First

    • Keep API keys in environment variables
    • Never commit sensitive data
  2. ⚡ Performance Tips

    • Use caching for repeated operations
    • Batch similar requests when possible
  3. 🛡️ Error Handling

    • Always handle exceptions gracefully
    • Validate outputs match expected formats

📜 License

MIT License - feel free to use in your own projects!

🤝 Contributing

Got ideas? Found a bug? Contributions are welcome! Feel free to:

  • Open an issue
  • Submit a pull request
  • Share your cool use cases

🌟 Star Us!

If you find Neuronic useful, give us a star! It helps others discover the project.

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

neuronic-0.3.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

neuronic-0.3.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file neuronic-0.3.0.tar.gz.

File metadata

  • Download URL: neuronic-0.3.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.0

File hashes

Hashes for neuronic-0.3.0.tar.gz
Algorithm Hash digest
SHA256 10dba6084202365f331a4839c943819c17f02288ce53d2ce4508bc2051ce7cce
MD5 0ed19ffdcc3d39048c7b56e22abe6e1e
BLAKE2b-256 8e16d3ab2da789900098bcc777ddd9ad48ebcb641e6861436157129cdede50b9

See more details on using hashes here.

File details

Details for the file neuronic-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: neuronic-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.0

File hashes

Hashes for neuronic-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 228afd17b27f52b93e0f688394f58e7971b8b201cde034e180d2224d361524aa
MD5 a278cf93f8cb1a2fc9c2e9b381acdb07
BLAKE2b-256 792ad54688fb8401a7a6f24f38ed07d7dc1c6df727225c104b13678005157586

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