1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # codegraph-python
//!
//! Python parser plugin for CodeGraph - extracts code entities and relationships
//! from Python source files.
//!
//! ## Features
//!
//! - Parse single Python files or entire projects
//! - Extract functions, classes, methods with full metadata
//! - Track relationships (calls, imports, inheritance)
//! - Configurable behavior (visibility filtering, parallel processing)
//! - Safe: No panics, graceful error handling
//!
//! ## Quick Start (New API - v0.2.0+)
//!
//! ```rust,no_run
//! use codegraph_python::PythonParser;
//! use codegraph_parser_api::CodeParser;
//! use codegraph::CodeGraph;
//! use std::path::Path;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut graph = CodeGraph::in_memory()?;
//! let parser = PythonParser::new();
//!
//! let file_info = parser.parse_file(Path::new("example.py"), &mut graph)?;
//! println!("Parsed {} functions", file_info.functions.len());
//! # Ok(())
//! # }
//! ```
//!
//! ## Legacy API (Deprecated in v0.2.0)
//!
//! ```rust,no_run,ignore
//! use codegraph_python::Parser;
//!
//! // This API is deprecated - use PythonParser with CodeParser trait instead
//! let parser = Parser::new();
//! ```
// Keep old config and error for backward compatibility with deprecated API
// Re-export parser-api types for convenience
pub use ;
// Export new parser implementation
pub use PythonParser;
// Legacy exports (deprecated)
pub use ParserConfig;
pub use ;
pub use ;