Crates.io | learnerd |
lib.rs | learnerd |
version | |
source | src |
created_at | 2024-11-03 23:51:23.499994 |
updated_at | 2024-11-10 22:33:27.968982 |
description | A simple daemon for learning stuff |
homepage | |
repository | https://github.com/autoparallel/learner |
max_upload_size | |
id | 1434390 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Academic Paper Management
Local Database Management
Command Line Interface (learnerd
)
Add this to your Cargo.toml
:
[dependencies]
learner = "0.2" # Core library
cargo install learnerd
which will install a binary you can reference with the command learner
.
use learner::{Paper, Database};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize database with default paths
let db = Database::open(Database::default_path()).await?;
// Add papers from various sources
let paper = Paper::new("https://arxiv.org/abs/2301.07041").await?;
paper.save(&db).await?;
// Download PDF if available
let pdf_dir = Database::default_pdf_path();
paper.download_pdf(pdf_dir).await?;
// Add papers from other sources
let paper = Paper::new("10.1145/1327452.1327492").await?; // From DOI
let paper = Paper::new("2023/123").await?; // From IACR
Ok(())
}
# Initialize a new database (interactive)
learner init
# Add a paper (auto-detects source)
learner add 2301.07041
learner add "https://arxiv.org/abs/2301.07041"
learner add "10.1145/1327452.1327492"
# Skip PDF download
learner add 2301.07041 --no-pdf
# Download PDF for existing paper
learner download arxiv 2301.07041
# Retrieve paper details
learner get arxiv 2301.07041
# Search papers
learner search "neural networks"
# Verbose output for debugging
learner -v add 2301.07041
# Clean up database (with confirmation)
learner clean
learnerd
can run as a background service for paper monitoring and updates.
Linux (sytemd
):
# Install and start
sudo learnerd daemon install
sudo systemctl daemon-reload
sudo systemctl enable --now learnerd
# Manage
sudo systemctl status learnerd # Check status
sudo journalctl -u learnerd -f # View logs
sudo systemctl restart learnerd # Restart service
# Remove
sudo systemctl disable --now learnerd
sudo learnerd daemon uninstall
MacOS (launchd
):
# Install and start
sudo learner daemon install
sudo launchctl load /Library/LaunchDaemons/learnerd.daemon.plist
# Manage
sudo launchctl list | grep learnerd # Check status
tail -f /Library/Logs/learnerd/learnerd.log # View logs
sudo launchctl kickstart -k system/learnerd.daemon # Restart
# Remove
sudo launchctl bootout system/learnerd.daemon
sudo learner daemon uninstall
Files: learnerd.log
(main, rotated daily), stdout.log
, stderr.log
The project consists of two main components:
learner
- Core library providing:
learnerd
- CLI application offering:
Contributions are welcome! Please feel free to submit a Pull Request. Before making major changes, please open an issue first to discuss what you would like to change.
The project maintains code quality through automated CI workflows:
Code Formatting
Code Quality
clippy: Rust's official linter for catching common mistakes and enforcing best practices
cargo-udeps: Identifies unused dependencies to keep the project lean
Testing
Release Safety
All CI checks must pass before merging pull requests, maintaining consistent quality across contributions.
This project uses just as a command runner.
# First time setup
cargo install just
just setup # installs dependencies, targets, and required tools
just # show all available commands
just ci # run all checks (fmt, lint, test, build)
just test # run test suite
just fmt # format code
just build-all # build all targets
just build-linux # linux (x86_64-musl)
just build-mac # macOS (arm64)
All commands support standard Cargo flags:
just test -- --release # run tests in release mode
just build -- --quiet # quiet build output
[!TIP] Running
just ci
locally ensures your code will pass CI checks!
The setup command will attempt to install required system dependencies, but if you need to install them manually:
sudo apt-get install pkg-config libssl-dev
brew install openssl@3
export OPENSSL_DIR=$(brew --prefix openssl@3) # Add to your shell profile
This project is licensed under the MIT License - see the LICENSE file for details.