{"id":30407690,"url":"https://github.com/datumbrain/otters","last_synced_at":"2026-02-17T19:05:00.160Z","repository":{"id":300927193,"uuid":"1007615572","full_name":"datumbrain/otters","owner":"datumbrain","description":"Otters are friends of Pandas and Polars. A Go library to work like a 10x engineer with your dataframes.","archived":false,"fork":false,"pushed_at":"2025-06-25T10:03:52.000Z","size":34,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T16:04:15.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datumbrain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-24T09:09:13.000Z","updated_at":"2025-07-19T20:54:18.000Z","dependencies_parsed_at":"2025-06-24T10:38:38.861Z","dependency_job_id":null,"html_url":"https://github.com/datumbrain/otters","commit_stats":null,"previous_names":["datumbrain/otters"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/datumbrain/otters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Fotters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Fotters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Fotters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Fotters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datumbrain","download_url":"https://codeload.github.com/datumbrain/otters/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datumbrain%2Fotters/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29554506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T18:16:07.221Z","status":"ssl_error","status_checked_at":"2026-02-17T18:16:04.782Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-21T20:44:12.723Z","updated_at":"2026-02-17T19:04:59.117Z","avatar_url":"https://github.com/datumbrain.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦦 Otters\n\n_Smooth, intelligent data processing for Go._\n\nOtters is a high-performance DataFrame library for Go, inspired by Pandas but designed for Go's strengths: type safety, performance, and simplicity.\n\n[![Go Version](https://img.shields.io/badge/go-1.19+-blue.svg)](https://golang.org)\n[![Go Report Card](https://goreportcard.com/badge/github.com/datumbrain/otters)](https://goreportcard.com/report/github.com/datumbrain/otters)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n## ✨ Features\n\n- 🎯 **Type-safe** - Native Go types (int64, float64, string, bool, time)\n- ⚡ **High performance** - Optimized for Go's strengths\n- 🛡️ **Memory safe** - No shared slices, proper error handling\n- 🐍 **Pandas-like API** - Familiar for data scientists\n- 🌊 **Fluent interface** - Chain operations naturally\n- 📁 **CSV support** - Read/write with automatic type inference\n- 🔍 **Rich operations** - Filter, sort, select, group, join\n- 📊 **Built-in statistics** - Sum, mean, std, describe, and more\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\ngo get github.com/datumbrain/otters\n```\n\n### Performance Benchmarks\n\n```raw\ngoos: darwin\ngoarch: arm64\npkg: github.com/datumbrain/otters\ncpu: Apple M2 Pro\nBenchmarkDataFrameOperations/Filter-10         \t    4258\t    283593 ns/op\nBenchmarkDataFrameOperations/Sort-10           \t    3748\t    329145 ns/op\nBenchmarkDataFrameOperations/GroupBy-10        \t     780\t   1544577 ns/op\nBenchmarkDataFrameOperations/Statistics-10     \t   12150\t     99351 ns/op\nPASS\nok  \tgithub.com/datumbrain/otters\t7.219s\n```\n\n### Basic Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"github.com/datumbrain/otters\"\n)\n\nfunc main() {\n    // Read CSV with automatic type inference\n    df, err := otters.ReadCSV(\"sales.csv\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Chain operations like Pandas\n    result := df.\n        Filter(\"amount\", \"\u003e\", 1000).\n        Select(\"region\", \"amount\", \"product\").\n        Sort(\"amount\", false) // descending\n\n    if err := result.Error(); err != nil {\n        log.Fatal(err)\n    }\n\n    // Get insights\n    totalSales, _ := result.Sum(\"amount\")\n    avgDeal, _ := result.Mean(\"amount\")\n    fmt.Printf(\"Total sales: $%.2f\\n\", totalSales)\n    fmt.Printf(\"Average deal: $%.2f\\n\", avgDeal)\n    fmt.Printf(\"Top deals: %d\\n\", result.Count())\n\n    // Save results\n    err = result.WriteCSV(\"top_sales.csv\")\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n```\n\n## 📊 Examples\n\n### Data Exploration\n\n```go\n// Load and explore data\ndf, _ := otters.ReadCSV(\"employees.csv\")\n\n// Basic info\nfmt.Println(\"Shape:\", df.Shape())        // (1000, 5)\nfmt.Println(\"Columns:\", df.Columns())   // [name, age, department, salary, hired_date]\n\n// Quick look\nfmt.Println(df.Head(5))   // First 5 rows\nfmt.Println(df.Tail(3))   // Last 3 rows\nfmt.Println(df.Describe()) // Summary statistics\n```\n\n### Filtering and Selection\n\n```go\n// Multiple filters\nhigh_earners := df.\n    Filter(\"salary\", \"\u003e\", 75000).\n    Filter(\"department\", \"==\", \"Engineering\").\n    Filter(\"age\", \"\u003c=\", 35)\n\n// Select specific columns\nsummary := high_earners.Select(\"name\", \"salary\", \"age\")\n\n// Complex conditions\nexperienced := df.Filter(\"age\", \"\u003e=\", 30).Filter(\"salary\", \"\u003e\", 60000)\n```\n\n### Sorting and Ranking\n\n```go\n// Sort by single column\ntop_paid := df.Sort(\"salary\", false) // descending\n\n// Multi-column sort\nranked := df.SortBy(\n    []string{\"department\", \"salary\"},\n    []bool{true, false}, // department ascending, salary descending\n)\n```\n\n### Aggregations and Statistics\n\n```go\n// Basic statistics\navgSalary, _ := df.Mean(\"salary\")\ntotalPayroll, _ := df.Sum(\"salary\")\nminSalary, _ := df.Min(\"salary\")\nmaxSalary, _ := df.Max(\"salary\")\nstdDev, _ := df.Std(\"salary\")\n\nfmt.Printf(\"Average salary: $%.2f\\n\", avgSalary)\nfmt.Printf(\"Total payroll: $%.2f\\n\", totalPayroll)\nfmt.Printf(\"Salary range: $%.2f - $%.2f\\n\", minSalary, maxSalary)\nfmt.Printf(\"Std deviation: $%.2f\\n\", stdDev)\n\n// Summary statistics for all numeric columns\nsummary, _ := df.Describe()\nfmt.Println(summary)\n```\n\n### Data Transformation\n\n```go\n// Create new columns\ndf_with_bonus := df.Copy()\n// Add 10% bonus calculation (implementation coming soon)\n\n// Rename columns\nclean_df := df.RenameColumn(\"hired_date\", \"start_date\")\n\n// Drop columns\nessential := df.Drop(\"internal_id\", \"notes\")\n```\n\n## 🏗️ API Reference\n\n### DataFrame Creation\n\n```go\n// From CSV\ndf, err := otters.ReadCSV(\"data.csv\")\ndf, err := otters.ReadCSVWithOptions(\"data.csv\", otters.CSVOptions{\n    HasHeader: true,\n    Delimiter: ',',\n    SkipRows:  1,\n})\n\n// From data\ndf, err := otters.NewDataFrameFromMap(map[string]interface{}{\n    \"name\":   []string{\"Alice\", \"Bob\", \"Carol\"},\n    \"age\":    []int64{25, 30, 35},\n    \"salary\": []float64{50000, 60000, 70000},\n})\n```\n\n### Data Operations\n\n```go\n// Filtering\ndf.Filter(\"column\", \"==\", value)    // Equal\ndf.Filter(\"column\", \"!=\", value)    // Not equal\ndf.Filter(\"column\", \"\u003e\", value)     // Greater than\ndf.Filter(\"column\", \"\u003e=\", value)    // Greater than or equal\ndf.Filter(\"column\", \"\u003c\", value)     // Less than\ndf.Filter(\"column\", \"\u003c=\", value)    // Less than or equal\n\n// Selection\ndf.Select(\"col1\", \"col2\", \"col3\")   // Select columns\ndf.Drop(\"col1\", \"col2\")             // Drop columns\n\n// Sorting\ndf.Sort(\"column\", true)             // Single column, ascending\ndf.Sort(\"column\", false)            // Single column, descending\ndf.SortBy([]string{\"col1\", \"col2\"}, []bool{true, false})\n```\n\n### Statistics\n\n```go\n// Basic stats\ndf.Count()                    // Number of rows\nsum, _ := df.Sum(\"column\")    // Sum of numeric column\nmean, _ := df.Mean(\"column\")  // Average of numeric column\nmin, _ := df.Min(\"column\")    // Minimum value\nmax, _ := df.Max(\"column\")    // Maximum value\nstd, _ := df.Std(\"column\")    // Standard deviation\n\n// Summary\nsummary, _ := df.Describe()   // Summary statistics for all numeric columns\n```\n\n### I/O Operations\n\n```go\n// CSV\ndf, err := otters.ReadCSV(\"input.csv\")\nerr = df.WriteCSV(\"output.csv\")\n\n// With options\ndf, err := otters.ReadCSVWithOptions(\"data.csv\", otters.CSVOptions{\n    HasHeader: true,\n    Delimiter: '\\t',\n    SkipRows:  2,\n    MaxRows:   1000,\n})\n```\n\n## 🎯 Design Philosophy\n\n### Pandas-Inspired, Go-Optimized\n\nOtters brings the familiar Pandas API to Go while embracing Go's strengths:\n\n- **Type Safety**: No more runtime type errors\n- **Performance**: Optimized for Go's memory model\n- **Simplicity**: Clean, readable code\n- **Error Handling**: Proper Go error handling patterns\n\n### Memory Safety\n\nUnlike many DataFrame libraries, Otters ensures:\n\n- No shared underlying slices\n- Proper deep copying when needed\n- No data races in concurrent usage\n- Explicit error handling, no panics\n\n### Performance First\n\n- Type-specific operations for maximum speed\n- Minimal allocations and copying\n- Efficient sorting and filtering algorithms\n- Memory-conscious design for large datasets\n\n## 🔄 Pandas Migration\n\nComing from Pandas? Here's how Otters compares:\n\n| Pandas                | Otters                      | Notes                    |\n| --------------------- | --------------------------- | ------------------------ |\n| `pd.read_csv()`       | `otters.ReadCSV()`          | Automatic type inference |\n| `df.head()`           | `df.Head(5)`                | Must specify count       |\n| `df[df.age \u003e 25]`     | `df.Filter(\"age\", \"\u003e\", 25)` | Explicit syntax          |\n| `df[['name', 'age']]` | `df.Select(\"name\", \"age\")`  | Method-based selection   |\n| `df.sort_values()`    | `df.Sort(\"column\", true)`   | Simple sort syntax       |\n| `df.describe()`       | `df.Describe()`             | Similar functionality    |\n\n## 🚧 Roadmap\n\n### ✅ MVP (Current)\n\n- [x] Core DataFrame with type safety\n- [x] CSV I/O with type inference\n- [x] Basic operations (filter, select, sort)\n- [x] Essential statistics\n- [x] Fluent API with error handling\n\n### 🔄 Coming Soon\n\n- [ ] GroupBy operations\n- [ ] Join operations (inner, left, right, outer)\n- [ ] More file formats (JSON, Parquet)\n- [ ] Advanced statistics\n- [ ] Data visualization helpers\n- [ ] Streaming operations for large files\n\n### 🎯 Future\n\n- [ ] SQL-like query interface\n- [ ] Integration with popular Go ML libraries\n- [ ] Advanced time series operations\n- [ ] Distributed processing capabilities\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n```bash\ngit clone https://github.com/datumbrain/otters.git\ncd otters\ngo mod tidy\ngo test ./...\n```\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Inspired by [Pandas](https://pandas.pydata.org/) for the API design\n- Built for the Go community with ❤️\n\n\u003e Like an otter in water - smooth, efficient, and playful with data. 🦦\n\n[![Made with ❤️ by Datum Brain](https://img.shields.io/badge/made%20with%20❤️%20by-Datum%20Brain-blue)](https://github.com/datumbrain)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatumbrain%2Fotters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatumbrain%2Fotters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatumbrain%2Fotters/lists"}