postloop 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- postloop/__init__.py +38 -0
- postloop/adapters.py +250 -0
- postloop/bootstrap.py +135 -0
- postloop/cli.py +143 -0
- postloop/commands.py +84 -0
- postloop/config.py +63 -0
- postloop/insights.py +167 -0
- postloop/matching.py +185 -0
- postloop/models.py +89 -0
- postloop/notify.py +101 -0
- postloop/output.py +119 -0
- postloop/plan.py +209 -0
- postloop/reconcile.py +133 -0
- postloop/tabular.py +101 -0
- postloop-0.1.0.dist-info/METADATA +197 -0
- postloop-0.1.0.dist-info/RECORD +20 -0
- postloop-0.1.0.dist-info/WHEEL +5 -0
- postloop-0.1.0.dist-info/entry_points.txt +2 -0
- postloop-0.1.0.dist-info/licenses/LICENSE +21 -0
- postloop-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: postloop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Plan, check and learn from your community's social media posts.
|
|
5
|
+
Author: Winnie
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/winniepopu/postloop
|
|
8
|
+
Project-URL: Source, https://github.com/winniepopu/postloop
|
|
9
|
+
Project-URL: Issues, https://github.com/winniepopu/postloop/issues
|
|
10
|
+
Keywords: community,social media,post calendar,automation,meta business suite,linkedin
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Office/Business
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: tzdata; sys_platform == "win32"
|
|
18
|
+
Provides-Extra: xlsx
|
|
19
|
+
Requires-Dist: openpyxl>=3.1; extra == "xlsx"
|
|
20
|
+
Provides-Extra: xls
|
|
21
|
+
Requires-Dist: xlrd>=2.0; extra == "xls"
|
|
22
|
+
Provides-Extra: sheets
|
|
23
|
+
Requires-Dist: gspread>=6.0; extra == "sheets"
|
|
24
|
+
Provides-Extra: all
|
|
25
|
+
Requires-Dist: openpyxl>=3.1; extra == "all"
|
|
26
|
+
Requires-Dist: xlrd>=2.0; extra == "all"
|
|
27
|
+
Requires-Dist: gspread>=6.0; extra == "all"
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
30
|
+
Requires-Dist: openpyxl>=3.1; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# postloop
|
|
34
|
+
|
|
35
|
+
**Plan, check and learn from your community's social media posts.**
|
|
36
|
+
|
|
37
|
+
Community organizers plan social media posts in a spreadsheet, then post them by
|
|
38
|
+
hand. Afterwards nobody goes back to update the sheet: statuses stay at
|
|
39
|
+
"drafting", the "published at" column stays empty, and nobody notices the post
|
|
40
|
+
that went out twice or the one that never went out. And next year, nobody
|
|
41
|
+
remembers which posts worked. postloop does those boring parts, and closes the
|
|
42
|
+
loop: plan, post, learn, plan again.
|
|
43
|
+
|
|
44
|
+
| You have | Run | You get |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| a post calendar and your platform exports | `postloop --plan ... --posts ...` | what went out, what didn't, what the sheet got wrong |
|
|
47
|
+
| only your platform exports | `postloop report --posts ...` | what worked: top posts, ads vs organic, gaps |
|
|
48
|
+
| last year's exports and a new event date | `postloop bootstrap --posts ...` | a draft calendar for this year |
|
|
49
|
+
|
|
50
|
+
## Check the calendar
|
|
51
|
+
|
|
52
|
+
You need two things you already have:
|
|
53
|
+
|
|
54
|
+
1. **your post calendar**: any spreadsheet with a date and a title per post
|
|
55
|
+
2. **your platform exports**: the CSV/Excel files Meta Business Suite and
|
|
56
|
+
LinkedIn let you download. No API keys, no data pipeline.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install "postloop[xlsx]"
|
|
60
|
+
|
|
61
|
+
postloop --plan calendar.xlsx --posts facebook.csv instagram.csv linkedin.xls
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Calendar: 54 planned posts (date: 'Date', title: 'Post')
|
|
66
|
+
Posts: facebook.csv β Meta Business Suite (Facebook), 45 posts
|
|
67
|
+
Posts: instagram.csv β Meta Business Suite (Instagram), 38 posts
|
|
68
|
+
|
|
69
|
+
π
Post calendar check
|
|
70
|
+
Matched 36 published posts
|
|
71
|
+
βοΈ Cells that can be filled in: 70
|
|
72
|
+
|
|
73
|
+
π‘ Posted, but status not updated
|
|
74
|
+
β’ 09/02 Conference guide (Drafting β facebook 09-02 21:00)
|
|
75
|
+
π΄ Date passed, no post found
|
|
76
|
+
β’ 10/19 Sprints sponsor thanks
|
|
77
|
+
β Posts missing from the calendar
|
|
78
|
+
β’ 09/15 [facebook] Sponsor spotlight ...
|
|
79
|
+
β Possibly posted twice
|
|
80
|
+
β’ 09/13 20:31 [facebook] Only 2 days left for tickets!
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
It fills in **facts** (when each post went out, and its link) and never makes
|
|
84
|
+
**decisions**: a status that looks out of date is reported, not changed.
|
|
85
|
+
|
|
86
|
+
## Your calendar
|
|
87
|
+
|
|
88
|
+
Only a **date** and a **title** column are required. postloop finds columns by
|
|
89
|
+
name, in English or Chinese (`Date`/`ζ₯ζ`/`ι θ¨ηΌεΈζ₯`, `Title`/`Post`/`ηΌζδΈ»ι‘`
|
|
90
|
+
...), and skips notes above the header. Optional columns it understands:
|
|
91
|
+
|
|
92
|
+
| What | Recognized as |
|
|
93
|
+
|---|---|
|
|
94
|
+
| where it is posted | checkbox columns named `FB`, `IG`, `LinkedIn`, `X`, `Threads`... or one `Platforms` column like `FB, IG` |
|
|
95
|
+
| status | `Status` / `ηζ
` |
|
|
96
|
+
| published at | `Published at` / `ε―¦ιηΌδ½ζ₯ζθζι` (postloop fills it in) |
|
|
97
|
+
| link | `URL` / `Link` / `ηΆ²ε` (postloop fills it in) |
|
|
98
|
+
|
|
99
|
+
No calendar yet? Start from [`templates/post-calendar.csv`](https://github.com/winniepopu/postloop/blob/main/templates/post-calendar.csv).
|
|
100
|
+
Different column names? `--date-col "When" --title-col "What"`.
|
|
101
|
+
|
|
102
|
+
## Your posts
|
|
103
|
+
|
|
104
|
+
| Platform | Where to download |
|
|
105
|
+
|---|---|
|
|
106
|
+
| Facebook | Meta Business Suite β Insights β Content β **Export data** β Facebook |
|
|
107
|
+
| Instagram | the same, choose Instagram |
|
|
108
|
+
| LinkedIn | your page β Analytics β Content β **Export** |
|
|
109
|
+
| anything else | a CSV with `platform, created_at, message, reactions` (+ `comments, shares, url`) |
|
|
110
|
+
|
|
111
|
+
The format is detected automatically. Meta allows 92 days per export; pass as
|
|
112
|
+
many files as you like, overlapping posts are counted once.
|
|
113
|
+
|
|
114
|
+
> **Gotcha we hit:** Meta writes publish times in **US Pacific time**, whatever
|
|
115
|
+
> your page's timezone. A post published at 10:10 in Taipei appears as 19:10 the
|
|
116
|
+
> evening before. postloop converts it; set your own zone with `--timezone`.
|
|
117
|
+
|
|
118
|
+
## Writing results back
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
postloop --plan calendar.xlsx --posts fb.csv --write # saves calendar_filled.xlsx
|
|
122
|
+
postloop --plan calendar.xlsx --posts fb.csv --report out.csv # one line per post, all platforms
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
With a Google Sheet (`pip install "postloop[sheets]"`), `--sheet-id ID --write`
|
|
126
|
+
fills the live sheet, and `--discord` posts the summary to `$DISCORD_WEBHOOK`.
|
|
127
|
+
Run both every morning with GitHub Actions: see
|
|
128
|
+
[`examples/pycontw/daily-check.yml`](https://github.com/winniepopu/postloop/blob/main/examples/pycontw/daily-check.yml).
|
|
129
|
+
|
|
130
|
+
## No calendar yet?
|
|
131
|
+
|
|
132
|
+
Start from what you already posted:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
postloop report --posts facebook.csv instagram.csv --timezone Asia/Seoul
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
For each platform: the typical post (median, so one viral post doesn't skew it),
|
|
139
|
+
the top posts by **organic** views (Meta exports say how many views came from
|
|
140
|
+
ads), boosted posts, post types, posts per month and the longest stretches with
|
|
141
|
+
no posts. It saves `post_report.md` and a CSV with every post.
|
|
142
|
+
|
|
143
|
+
## Plan next year from last year
|
|
144
|
+
|
|
145
|
+
A yearly event posts much the same things each year. Turn last year's posts into
|
|
146
|
+
a draft calendar:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
postloop bootstrap --posts facebook.csv instagram.csv --timezone Asia/Seoul \
|
|
150
|
+
--event-date 2026-10-17 --next-event 2027-10-16
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Each post is placed the same number of days before the next event, on the same
|
|
154
|
+
weekday, with the year in its title updated and last year's numbers next to it.
|
|
155
|
+
A post that went out on several platforms becomes one row. The draft is a
|
|
156
|
+
starting point: if a deadline moved this year (early bird, proposals), move those
|
|
157
|
+
rows by hand.
|
|
158
|
+
|
|
159
|
+
## How matching works
|
|
160
|
+
|
|
161
|
+
Dates alone are unreliable: posts go out late, and several share a day. Each
|
|
162
|
+
calendar row and post pair gets a score from:
|
|
163
|
+
|
|
164
|
+
- **text similarity**: character pairs of the title found in the start of the
|
|
165
|
+
post, weighted by rarity, so "PyCon" (in every post) counts little and a
|
|
166
|
+
speaker's name counts a lot. Works for Chinese and English without a tokenizer.
|
|
167
|
+
- **sequence numbers**: "Part 2", "#2", "Day 2" and "第δΊε€©" must agree
|
|
168
|
+
- **lateness**: a small penalty per day late
|
|
169
|
+
|
|
170
|
+
Pairs are assigned best-first, one post per row. Low-confidence matches are
|
|
171
|
+
listed for a human to check.
|
|
172
|
+
|
|
173
|
+
Teach postloop your community's words in a config file (`--config postloop.toml`):
|
|
174
|
+
|
|
175
|
+
```toml
|
|
176
|
+
[synonyms]
|
|
177
|
+
shorts = "interview" # the calendar says "shorts", the post says "interview"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
On PyCon Taiwan's 2026 calendar it matched 32 of 36 Facebook posts with no
|
|
181
|
+
configuration, and 35 of 36 with no wrong matches once given ten synonyms.
|
|
182
|
+
|
|
183
|
+
## Examples
|
|
184
|
+
|
|
185
|
+
[`examples/pycontw/`](https://github.com/winniepopu/postloop/tree/main/examples/pycontw/) is how PyCon Taiwan runs it every
|
|
186
|
+
morning: their config, their GitHub Actions workflow, and how to feed postloop
|
|
187
|
+
from your own database instead of from exports.
|
|
188
|
+
|
|
189
|
+
## Development
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
pip install -e ".[dev]"
|
|
193
|
+
pytest
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Releases are published to PyPI by `.github/workflows/publish.yml` when a GitHub
|
|
197
|
+
release is created.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
postloop/__init__.py,sha256=IYjJL6kTxt-549NzXP8fu6wZ7pHUdnmQfLBPTA5CHPQ,1067
|
|
2
|
+
postloop/adapters.py,sha256=2Xp_e5dAhhoTeLhxWlCsv8vAhz6rZzrgNdkYGOeHrtU,9923
|
|
3
|
+
postloop/bootstrap.py,sha256=01XuLTVxZWM9c7RulqR0rJwXD3vJ3ekZ0PneUwq3pU8,6461
|
|
4
|
+
postloop/cli.py,sha256=1hX4jPTl-rryFwtR95sqjuAvB8R_8euE6m3mQF3u5TU,6477
|
|
5
|
+
postloop/commands.py,sha256=os88rfQkCIWDWlf38yhiigB1j7ecJEdrNxQz1AYoPJ4,3973
|
|
6
|
+
postloop/config.py,sha256=SYQc1oJh1rGW-xqqXZiDXNV1xG5-FHvozJzpK_AfC1c,2740
|
|
7
|
+
postloop/insights.py,sha256=j_0Tn3JftbvrGj6TO-G8yYT61QLu-sgeiv9byfF1uVo,7642
|
|
8
|
+
postloop/matching.py,sha256=w8lWpqHZjO15HCDegNwRLxRhmiG6FeOy2WyvrPiZsBM,7105
|
|
9
|
+
postloop/models.py,sha256=mWPu3oPogO3hhHPKU917i0bZ3FuZ7bALOUSVVvBJVZw,2786
|
|
10
|
+
postloop/notify.py,sha256=f6TyHM3wpmu11CKL6zQ_B5cJX-SnxHWXhiihFWLBisY,3977
|
|
11
|
+
postloop/output.py,sha256=Gm2KyAUryUjmpXU1hw-_xENeloy5gjl0I8mZUiFUeZ0,5269
|
|
12
|
+
postloop/plan.py,sha256=MoST6ruQGAw9BkegYAaCrCaAbLHsswWwAfwQrXQvRN8,9084
|
|
13
|
+
postloop/reconcile.py,sha256=gAqcI2dzK4YPYYoCZLP8z60wx6YpzOMtMQ8K4TqSZro,5549
|
|
14
|
+
postloop/tabular.py,sha256=z7QsjUujzMKnGUDm37rABL1mNUwLaL5iFVreqKDPVAU,3674
|
|
15
|
+
postloop-0.1.0.dist-info/licenses/LICENSE,sha256=P1HiliRbg1crSmErNw_-Xu4Vf9GoAgjpJXzy8DBubeo,1063
|
|
16
|
+
postloop-0.1.0.dist-info/METADATA,sha256=30iYpbiWDgz5RNBZNVTooZRW700a6j3fNODTjY9nmnI,7799
|
|
17
|
+
postloop-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
18
|
+
postloop-0.1.0.dist-info/entry_points.txt,sha256=EJ_7biA7JZAk6vB68ohgT55qB8ivaZ7y1jhLzwa5ZZI,47
|
|
19
|
+
postloop-0.1.0.dist-info/top_level.txt,sha256=M5xo2BRdF_fwHZfTBK1_emHKAZSOwijLfsncD1xkmTI,9
|
|
20
|
+
postloop-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Winnie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
postloop
|