| Crates.io | axis-core |
| lib.rs | axis-core |
| version | 1.0.0 |
| created_at | 2025-11-29 12:23:07.031539+00 |
| updated_at | 2025-11-29 12:23:07.031539+00 |
| description | AXIS-CORE SDK for programmatic web accessibility checking (Rust) |
| homepage | |
| repository | https://github.com/ABHIRAM-CREATOR06/Acess1 |
| max_upload_size | |
| id | 1956630 |
| size | 84,941 |
A fast, memory-safe Rust library for automated web accessibility checking. Built with performance and reliability in mind.
Add this to your Cargo.toml:
[dependencies]
axis-core = "1.0"
use axis_core::AxisCore;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let checker = AxisCore::new();
let report = checker.check_url("https://example.com").await?;
println!("Accessibility Score: {}/100", report.accessibility_score);
println!("Issues Found: {}", report.total_issues);
Ok(())
}
Main SDK struct for accessibility checking.
new() -> AxisCore: Create a new checker instancecheck_url(url: &str) -> Result<Report>: Check a website by URLcheck_html(html: &str, base_url: Option<&str>) -> Report: Check HTML contentexport_to_text(report: &Report) -> String: Export report as textversion() -> &'static str: Get SDK versionContains the results of an accessibility analysis.
issues: Vec<Issue> - All issues foundtotal_issues: usize - Total number of issueserror_count/warning_count/info_count: usize - Issues by severityaccessibility_score: u32 - Score from 0-100compliance_status: String - Overall compliance levelpage_load_time: f64 - Load time in secondsenergy_consumption_kwh: f64 - Estimated energy useco2_emissions_grams: f64 - Estimated carbon emissionsRepresents a single accessibility issue.
issue_type: String - Type of issue (e.g., "Missing Alt Text")element_snippet: Option<String> - HTML snippet where issue was foundsuggested_fix: Option<String> - How to fix the issueseverity: Severity - Error, Warning, or Infofix_example: Option<String> - Example fix codecategory: Category - Issue categoryuse axis_core::AxisCore;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let checker = AxisCore::new();
let report = checker.check_url("https://example.com").await?;
match report.accessibility_score {
95..=100 => println!("Fully compliant!"),
80..=94 => println!("Mostly compliant"),
60..=79 => println!("Needs improvement"),
_ => println!("Major accessibility issues"),
}
Ok(())
}
use axis_core::AxisCore;
let checker = AxisCore::new();
let html = r#"<html><body><img src="test.jpg" /></body></html>"#;
let report = checker.check_html(html, None);
// Check for missing alt text
for issue in &report.issues {
if issue.issue_type.contains("Alt Text") {
println!("Found accessibility issue: {}", issue.suggested_fix.as_deref().unwrap_or("Unknown"));
}
}
use axis_core::AxisCore;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let checker = AxisCore::new();
let report = checker.check_url("https://example.com").await?;
let text_report = checker.export_to_text(&report);
std::fs::write("accessibility-report.txt", text_report)?;
Ok(())
}
AXIS-CORE is designed for high performance:
scraperThe SDK uses Rust's Result type for error handling:
match checker.check_url("https://example.com").await {
Ok(report) => println!("Score: {}", report.accessibility_score),
Err(e) => eprintln!("Error: {}", e),
}
Issues and pull requests welcome! This SDK is built with Rust's safety and performance guarantees.
GPL-3.0-or-later
Built with ❤️ for a more accessible web