| Crates.io | fluxus-source-gharchive |
| lib.rs | fluxus-source-gharchive |
| version | 0.1.0 |
| created_at | 2025-05-14 02:56:24.846924+00 |
| updated_at | 2025-05-14 02:56:24.846924+00 |
| description | A Fluxus source component for processing and analyzing GitHub Archive data streams, providing efficient access to historical GitHub event data. |
| homepage | https://github.com/fluxus-labs/fluxus-source-gharchive |
| repository | https://github.com/fluxus-labs/fluxus-source-gharchive |
| max_upload_size | |
| id | 1672820 |
| size | 97,746 |
A Fluxus source component for processing and analyzing GitHub Archive data streams, providing efficient access to historical GitHub event data.
fluxus-source-gharchive is a powerful Rust library that enables seamless integration with GitHub Archive data. It provides a robust interface for streaming and processing historical GitHub events, supporting both HTTP-based remote access and local file processing.
Flexible Data Source Support
Advanced Time Range Control
Comprehensive Event Data
Robust Error Handling
Add this to your Cargo.toml:
[dependencies]
fluxus-source-gharchive = "0.1"
use fluxus_source_gharchive::GithubArchiveSource;
use fluxus::sources::Source;
#[tokio::main]
async fn main() {
// Create a source for a specific hour
let uri = "https://data.gharchive.org/2015-01-01-15.json.gz";
let mut source = GithubArchiveSource::new(uri).unwrap();
// Configure timeout
source.set_io_timeout(std::time::Duration::from_secs(20));
// Initialize the source
source.init().await.unwrap();
// Process events
while let Ok(Some(event)) = source.next().await {
println!("Event: {:?}", event);
}
}
use fluxus_source_gharchive::GithubArchiveSource;
use fluxus::sources::Source;
#[tokio::main]
async fn main() {
// Create a source starting from a specific date
let mut source = GithubArchiveSource::from_date("2021-01-01").unwrap();
// Set end date (optional)
source.set_end_date("2021-01-02").unwrap();
// Initialize and process
source.init().await.unwrap();
while let Ok(Some(event)) = source.next().await {
println!("Event: {:?}", event);
}
}
use fluxus_source_gharchive::GithubArchiveSource;
use fluxus::sources::Source;
use std::path::Path;
#[tokio::main]
async fn main() {
// Create a source from a local file
let path = Path::new("path/to/your/archive.json.gz");
let mut source = GithubArchiveSource::from_file(path).unwrap();
// Initialize and process
source.init().await.unwrap();
while let Ok(Some(event)) = source.next().await {
println!("Event: {:?}", event);
}
}
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.