
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
logseq-python
Advanced tools
The most comprehensive Python library for Logseq knowledge graph interaction
Transform your Logseq workflow with programmatic access to every major feature. From basic note-taking to advanced task management, academic research, and knowledge graph analytics - this library supports it all.
pip install logseq-py
Or for development:
git clone https://github.com/yourusername/logseq-python.git
cd logseq-python
pip install -e .
from logseq_py import LogseqClient, TaskState, Priority
# Initialize client with your Logseq graph directory
client = LogseqClient("/path/to/your/logseq/graph")
graph = client.load_graph()
# Find all high-priority tasks
urgent_tasks = client.query().blocks().has_priority(Priority.A).execute()
# Get overdue tasks
from datetime import date
overdue = client.query().blocks().has_deadline().custom_filter(
lambda block: block.deadline.date < date.today()
).execute()
# Find completed tasks
completed = client.query().blocks().has_task_state(TaskState.DONE).execute()
# Get workflow summary
workflow = client.graph.get_workflow_summary()
print(f"Completion rate: {workflow['completed_tasks']}/{workflow['total_tasks']}")
# Find all Python code blocks
python_code = client.query().blocks().is_code_block(language="python").execute()
# Get math/LaTeX content
math_blocks = client.query().blocks().has_math_content().execute()
# Find all headings
headings = client.query().blocks().is_heading().execute()
# Get blocks with references
linked_blocks = client.query().blocks().has_block_references().execute()
# Get comprehensive graph insights
insights = client.graph.get_graph_insights()
# Analyze namespaces
for namespace in client.graph.get_all_namespaces():
pages = client.graph.get_pages_by_namespace(namespace)
print(f"{namespace}/: {len(pages)} pages")
# Find most connected pages
for page_name, connections in insights['most_connected_pages'][:5]:
print(f"{page_name}: {connections} backlinks")
# Add journal entry with task
client.add_journal_entry("TODO Review project documentation #urgent")
# Create a structured page
content = """# Project Planning
- TODO Set up initial framework [#A]
SCHEDULED: <2024-01-15 Mon>
- Code review checklist
- [ ] Security audit
- [ ] Performance testing"""
client.create_page("Project Alpha", content)
# Find all overdue high-priority tasks and generate a report
from datetime import date, timedelta
overdue_urgent = (client.query()
.blocks()
.is_task()
.has_priority(Priority.A)
.has_deadline()
.custom_filter(lambda b: b.deadline.date < date.today())
.execute())
for task in overdue_urgent:
days_overdue = (date.today() - task.deadline.date).days
print(f"⚠️ OVERDUE {days_overdue} days: {task.content}")
# Analyze your coding activity across languages
code_stats = {}
for block in client.query().blocks().is_code_block().execute():
lang = block.code_language or 'unknown'
code_stats[lang] = code_stats.get(lang, 0) + 1
print("📊 Code block distribution:")
for lang, count in sorted(code_stats.items(), key=lambda x: x[1], reverse=True):
print(f" {lang}: {count} blocks")
# Find your most referenced pages (knowledge hubs)
page_refs = {}
for block in client.query().blocks().has_block_references().execute():
for ref in block.referenced_blocks:
page_refs[ref] = page_refs.get(ref, 0) + 1
print("🔗 Most referenced content:")
for ref, count in sorted(page_refs.items(), key=lambda x: x[1], reverse=True)[:10]:
print(f" {ref}: {count} references")
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License is a permissive license that allows for commercial use, modification, distribution, and private use, with the only requirement being that the license and copyright notice must be included with any substantial portions of the software.
FAQs
A comprehensive Python library for working with Logseq knowledge graphs
We found that logseq-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.