PHP App Library Classifier
Analyze and classify PHP libraries used in any project directory with a modern, containerized tool. Outputs structured JSON for easy integration and analysis.
Features
- Automatic library detection for PHP projects
- Structured JSON output
- Dockerized for easy use
- No dependencies on host system
- Fast and efficient analysis
Usage
CLI
php-app-lib-classifier /path/to/php/app [--json] [--verbose]
php-app-lib-classifier version
/path/to/php/app: Path to the PHP application to analyze.--json: Output results in JSON format.--verbose: Enable verbose logging.
Docker
docker run --rm -it -v /path/to/your/php/app:/var/www/html ghcr.io/wangyihang/php-app-lib-classifier:main /var/www/html --json
/path/to/your/php/app: Local path to your PHP application.- The output will be in JSON format.
Python API
Simple Function Interface (Recommended)
from php_app_lib_classifier import classify, ProjectType, ConfidenceLevel
# Get object result
result = classify("/path/to/php/app")
print(f"Project type: {result.project_type.value}") # Enum value
print(f"Confidence: {result.get_confidence_level()[0].value}") # Enum value
# Check specific types
if result.project_type == ProjectType.LIBRARY:
print("This is a library project")
# Get JSON result
json_result = classify("/path/to/php/app", output_json=True)
print(json_result)
Class Interface
from php_app_lib_classifier import LibraryClassifier
result = LibraryClassifier.classify("/path/to/php/app", output_json=True)
print(result)
classify(path, output_json=False, verbose=False): Simple function interface to analyze PHP applications and return resultsLibraryClassifier.classify(path, output_json=True): Class interface to analyze PHP applications and return results (optionally as JSON)
Requirements
- Docker
Architecture
- LibraryClassifier: Core logic for detecting and classifying PHP libraries
- CLI Interface: Simple command-line usage via Docker
- JSON Output: Structured results for downstream processing
- Enum Types: Type-safe project types and confidence levels
Enum Types
The library provides Enum types for better type safety:
from php_app_lib_classifier import ProjectType, ConfidenceLevel, ConfidenceColor
# Project types
ProjectType.LIBRARY # "Library"
ProjectType.WEB_APPLICATION # "Web Application"
ProjectType.HYBRID_UNCLEAR # "Hybrid/Unclear"
# Confidence levels
ConfidenceLevel.HIGH # "High"
ConfidenceLevel.MEDIUM # "Medium"
ConfidenceLevel.LOW # "Low"
- Detection Strategies:
- Composer dependency analysis
- File and directory pattern matching
- Content-based heuristics
Contributing
- Fork & branch
- Add features or tests
- Ensure all tests pass (if applicable)
- Submit a pull request
License
MIT License. See LICENSE.
Changelog
v0.2.0
- Improved detection logic, structured output, and Docker usability
v0.1.0
- Initial release
Metadata
Release files for php-app-lib-classifier 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| php_app_lib_classifier-0.1.3.tar.gz | 26.0 kB | Without provenance | Details for php_app_lib_classifier-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| php_app_lib_classifier-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for php_app_lib_classifier-0.1.3-py3-none-any.whl |
Total release size: 46.7 kB
Release files / php_app_lib_classifier-0.1.3.tar.gz
| Download URL | php_app_lib_classifier-0.1.3.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c55a8a1de128b011c82f7087d767a8f097bd05fd7a823e63b243b3318c917054
|
|
BLAKE2b-256 checksum How to use checksums |
94abab6ae46065476247f8495a862c66844233cddcedac8f9f3448df4fafccc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.7.19
|
Release files / php_app_lib_classifier-0.1.3-py3-none-any.whl
| Download URL | php_app_lib_classifier-0.1.3-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4714b9170c16cfc739f139448c85172746bf60e02021cd755e225da10b5383dc
|
|
BLAKE2b-256 checksum How to use checksums |
65cb9d0411bd06e3465879301284169145ee4bc2506baa8a139c271194d52358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.7.19
|
Security for php-app-lib-classifier 0.1.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.