AiCV Python SDK - AI-powered CV analysis and generation toolkit | AiCV Python SDK - 智能简历分析与生成工具包
Project description
AiCV Python SDK
A comprehensive AI-powered CV analysis and generation toolkit for Python developers.
Features
- 🤖 AI-Powered Analysis: Analyze CVs with advanced AI algorithms
- ✍️ Content Generation: Generate CV sections with AI assistance
- 🎯 Optimization: Optimize CVs for ATS compatibility and impact
- 🔧 Easy Integration: Simple Python SDK with comprehensive documentation
- 🚀 High Performance: Built with modern Python async/await support
- 📊 Rich Analytics: Detailed insights and recommendations
Installation
pip install aicv-python
Quick Start
Basic Usage
from aicv import AiCVClient
# Initialize the client
client = AiCVClient(api_key="your-api-key")
# Analyze a CV
result = client.analyze_cv("""
John Doe
Software Engineer
5 years of experience in Python development
...
""")
print(result)
Advanced Usage
from aicv import AiCVClient
# Initialize with custom settings
client = AiCVClient(
api_key="your-api-key",
base_url="https://api.aicv.chat",
timeout=60.0
)
# Generate a CV section
section = client.generate_cv_section(
section_type="summary",
context="Senior Python Developer with 5 years experience",
requirements="Focus on AI/ML expertise"
)
# Optimize a CV
optimized = client.optimize_cv(
cv_text="Your CV content here...",
target_job="Senior Python Developer at Tech Company"
)
Context Manager Usage
from aicv import AiCVClient
with AiCVClient(api_key="your-api-key") as client:
result = client.analyze_cv("Your CV content...")
print(result)
API Reference
AiCVClient
The main client class for interacting with the AiCV API.
Constructor
AiCVClient(
api_key: str,
base_url: str = "https://api.aicv.chat",
timeout: float = 30.0,
**kwargs
)
Parameters:
api_key(str): Your AiCV API keybase_url(str): Base URL for the API (default: https://api.aicv.chat)timeout(float): Request timeout in seconds (default: 30.0)**kwargs: Additional arguments passed to httpx.Client
Methods
analyze_cv(cv_text: str, analysis_type: str = "comprehensive")
Analyze a CV and provide insights.
Parameters:
cv_text(str): The CV text to analyzeanalysis_type(str): Type of analysis ('comprehensive', 'skills', 'experience')
Returns: Analysis results as dictionary
generate_cv_section(section_type: str, context: str, requirements: str = None)
Generate a specific CV section.
Parameters:
section_type(str): Type of section ('summary', 'experience', 'skills', 'education')context(str): Context information for generationrequirements(str, optional): Specific requirements for the section
Returns: Generated content as dictionary
optimize_cv(cv_text: str, target_job: str = None)
Optimize a CV for better ATS compatibility and impact.
Parameters:
cv_text(str): The CV text to optimizetarget_job(str, optional): Target job description for optimization
Returns: Optimization suggestions as dictionary
get_account_info()
Get account information and usage statistics.
Returns: Account information as dictionary
health_check()
Check API health status.
Returns: Health status as dictionary
Command Line Interface
The SDK also provides a command-line interface:
# Analyze a CV
aicv analyze --api-key YOUR_KEY --cv-text "Your CV content..."
# Generate content
aicv generate --api-key YOUR_KEY --section-type summary --context "Senior Developer"
# Optimize a CV
aicv optimize --api-key YOUR_KEY --cv-text "Your CV content..." --target-job "Job description"
# Check account info
aicv account --api-key YOUR_KEY
# Health check
aicv health --api-key YOUR_KEY
Error Handling
The SDK provides comprehensive error handling:
from aicv import AiCVClient, AuthenticationError, APIError, ValidationError
try:
client = AiCVClient(api_key="your-api-key")
result = client.analyze_cv("CV content...")
except AuthenticationError:
print("Invalid API key")
except APIError as e:
print(f"API error: {e}")
except ValidationError as e:
print(f"Validation error: {e}")
Examples
Complete CV Analysis Workflow
from aicv import AiCVClient
def analyze_and_optimize_cv(cv_text, target_job=None):
"""Complete workflow for CV analysis and optimization."""
with AiCVClient(api_key="your-api-key") as client:
# Step 1: Analyze the CV
analysis = client.analyze_cv(cv_text, analysis_type="comprehensive")
print("Analysis Results:", analysis)
# Step 2: Optimize if target job is provided
if target_job:
optimization = client.optimize_cv(cv_text, target_job)
print("Optimization Suggestions:", optimization)
# Step 3: Generate improved sections if needed
if analysis.get('needs_improvement'):
improved_summary = client.generate_cv_section(
section_type="summary",
context=cv_text,
requirements="Professional and impactful"
)
print("Improved Summary:", improved_summary)
return analysis
# Usage
result = analyze_and_optimize_cv(
cv_text="Your CV content...",
target_job="Senior Python Developer at AI Company"
)
Batch Processing
from aicv import AiCVClient
def batch_analyze_cvs(cv_list, api_key):
"""Analyze multiple CVs in batch."""
results = []
with AiCVClient(api_key=api_key) as client:
for i, cv_text in enumerate(cv_list):
try:
result = client.analyze_cv(cv_text)
results.append({
'index': i,
'status': 'success',
'result': result
})
except Exception as e:
results.append({
'index': i,
'status': 'error',
'error': str(e)
})
return results
# Usage
cv_list = ["CV 1 content...", "CV 2 content...", "CV 3 content..."]
results = batch_analyze_cvs(cv_list, "your-api-key")
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/AIGility-Cloud-Innovation/aicv-python.git
cd aicv-python
# Install development dependencies
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=aicv --cov-report=html
# Run specific test
pytest tests/test_client.py -v
Code Quality
# Format code
black aicv/ tests/
# Sort imports
isort aicv/ tests/
# Lint code
flake8 aicv/ tests/
# Type checking
mypy aicv/
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- 📧 Email: contact@aigility.cn
- 📖 Documentation: https://aicv-python.readthedocs.io
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
Changelog
See CHANGELOG.md for a list of changes and version history.
Made with ❤️ by AIGility Cloud Innovation
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aicv_python-0.1.3.tar.gz.
File metadata
- Download URL: aicv_python-0.1.3.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ada73cc1707bbba9f246c6b8ec457db6d673b649bb9bdcd0a4ff0c8ef101c7b
|
|
| MD5 |
5d1c473a57f5e985ab7465d03553ffd9
|
|
| BLAKE2b-256 |
30c38733f982a782e6f289a66da1a335e4e9dc5b4cb12e10621512d0112462f7
|
File details
Details for the file aicv_python-0.1.3-py3-none-any.whl.
File metadata
- Download URL: aicv_python-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecd5704a7be78b181ff53eac0d35cf8e623a56e8e48f9a05d78287c4dada145d
|
|
| MD5 |
39bd4bb457cd0fadfb083e382aee6d56
|
|
| BLAKE2b-256 |
a7ae623182f0c3c76fcee2d2f279fdfc608127d3b95338cf9391666074eeb59d
|