Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aptabase"
version = "0.0.1"
version = "0.0.2"
description = "Python SDK for Aptabase analytics"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This is a simple counter app that:
uv pip install textual aptabase

# Run the app
uv run main.py
uv run counter.py
```

#### Using pip
Expand All @@ -49,7 +49,7 @@ source venv/bin/activate # On Windows: venv\Scripts\activate
pip install textual aptabase

# Run the app
python main.py
python counter.py
```

#### Using pyproject.toml
Expand All @@ -67,7 +67,7 @@ Before running, you need to set your Aptabase app key:
1. Sign up at [aptabase.com](https://aptabase.com/)
2. Create a new app
3. Copy your app key (format: `A-EU-XXXXXXXXXX` or `A-US-XXXXXXXXXX`)
4. Update the key in `simple_counter.py`:
4. Update the key in `counter.py`:

```python
# Replace with your actual Aptabase app key
Expand Down Expand Up @@ -120,7 +120,7 @@ Sent when the app exits.

## 🎮 Usage

1. **Start the app**: Run `python simple_counter.py`
1. **Start the app**: Run `python main.py`
2. **Click the button**: Press "Click Me!" to increment (or press `Enter` when focused)
3. **Reset**: Click "Reset" to set counter back to zero
4. **Quit**: Press `q` or `Ctrl+C`
Expand Down Expand Up @@ -244,55 +244,31 @@ pip install textual aptabase
python --version # Must be 3.11+
```

## 📚 Learn More

### Next Steps

Once you're comfortable with this simple example, check out:

1. **textual_aptabase_demo.py** - Full dashboard with tabs, forms, and real-time stats
2. **advanced_patterns.py** - User identification, error tracking, performance monitoring
### Events don't show

### Resources
Make sure to check the Debug-mode dashboard (not Release-mode)

- **Aptabase**: [https://aptabase.com/docs](https://aptabase.com/docs)
- **Aptabase Python SDK**: [https://github.com/aptabase/aptabase-py](https://github.com/aptabase/aptabase-py)
- **Textual**: [https://textual.textualize.io/](https://textual.textualize.io/)
- **Textual Tutorial**: [https://textual.textualize.io/tutorial/](https://textual.textualize.io/tutorial/)

## 🔐 Privacy
## 📚 Learn More

Aptabase is privacy-first analytics:
- ✅ No personal data collected
- ✅ No IP addresses stored
- ✅ No cookies or tracking
- ✅ GDPR compliant
- ✅ Open source
## Resources

This example only tracks:
- Counter values (anonymous)
- Button click events
- Session duration
- App lifecycle events
- [Aptabase Documentation](https://aptabase.com/docs)
- [Textual Documentation](https://textual.textualize.io/)
- [Aptabase Python SDK](https://github.com/aptabase/aptabase-python)

## 📄 License
## License

MIT License - feel free to use this as a starting point for your own projects!

## 🤝 Contributing
## Contributing

This is a simple example/demo. Feel free to:
- Fork and modify
- Use in your own projects
- Share improvements
This is a demo app. Feel free to fork and modify for your needs!

## Questions?
## Questions?

- **Aptabase Support**: [https://aptabase.com/](https://aptabase.com/)
- **Textual Discord**: [https://discord.gg/Enf6Z3qhVr](https://discord.gg/Enf6Z3qhVr)
- Aptabase: [https://aptabase.com/](https://aptabase.com/)
- Textual: [https://textual.textualize.io/](https://textual.textualize.io/)

---

**Happy coding!** 🚀

Built with ❤️ using [Textual](https://textual.textualize.io/) and [Aptabase](https://aptabase.com/)
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class CounterApp(App):
}
"""

BINDINGS = [
("q", "quit", "Quit"),
("ctrl+c", "quit", "Quit"),
]

def __init__(self, app_key: str = "A-EU-0000000000"):
super().__init__()
self.app_key = app_key
Expand Down Expand Up @@ -87,8 +92,12 @@ async def on_button_pressed(self, event: Button.Pressed) -> None:
counter_widget = self.query_one("#counter", Static)
counter_widget.update(f"[bold cyan]Count: {self.counter}[/bold cyan]")


if __name__ == "__main__":
def main():
"""Run the counter app"""
# Replace with your Aptabase app key
app = CounterApp(app_key="A-EU-0000000000")
app.run()
app.run()


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ description = "A simple counter app demonstrating Aptabase analytics integration
authors = [
{name = "Your Name", email = "your.email@example.com"}
]
readme = "README_COUNTER.md"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"textual>=6.7.1",
"aptabase>=0.0.1",
"aptabase>=0.0.2",
]
license = {text = "MIT"}
keywords = ["textual", "tui", "analytics", "aptabase", "counter"]
Expand All @@ -30,7 +30,7 @@ Repository = "https://github.com/yourusername/textual-aptabase-counter"
"Bug Tracker" = "https://github.com/yourusername/textual-aptabase-counter/issues"

[project.scripts]
counter = "main:main"
counter = "counter:main"

[build-system]
requires = ["hatchling"]
Expand Down
214 changes: 214 additions & 0 deletions samples/textual-counter/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ pip install
# Or with uv
uv sync
```
### Events don't show

Make sure to check the Debug-mode dashboard (not Release-mode)

## Resources

Expand Down
Loading