Code Monkey home page Code Monkey logo

memacs's Introduction

What were you doing on February 14th of 2007? On which tasks were you working on that very day you met your girl friend? When was the last appointments with your dentist? Who called you on telephone during that meeting with your customer last month?

Most people can not answer such questions. With Memacs you can!

Memacs extracts metadata (subjects, timestamps, contact information, …) from many different existing data sources (file names, emails, tweets, bookmarks, …) on your computer and generates files which are readable by GNU Emacs with Org mode.

Example:

   emails              -> memacs-maildir.py  \
   firefox history     -> memacs-firefox.py   |
   SMS                 -> memacs-sms.py       |
   RSS-feeds           -> memacs_rss.py       |
   bank statements     -> memacs-easybank.py  |>  Memacs
   postings            -> memacs-slrn.org     |
   git repository logs -> memacs_git.py       |
   svn repository logs -> memacs_svn.py      /
   |_________________|   |_________________|     |______|
   your personal data      Memacs modules        Org mode

Memacs - as the central component of the system - is a hub for all the connectors that add data from individual data sources. Those connectors are called Memacs modules or short module.

Your agenda automatically gets populated with entries similar to the example shown in the screenshot from the white paper:

https://github.com/novoid/screencasts/raw/master/memacs/2012-04-08_Memacs_2008-09-15_archive.png

You can see some demo data using the modulees for SMS, filenamedatestamps, Twitter, RSS, imap, phonecalls, and git.

Table of Contents

Installation

Install using Pip

The easiest way of installing Memacs is by using `pip`:

pip install memacs[all]

This gets you the whole set of modules with all dependencies on your system.

If you would like to define the dependencies more fine-grained, you can use one or more of the extras: gps, rss, ical, lastfm, battery, or twitter like the following example:

pip install memacs[gps,rss]

Manual Setup from Git

In case you prefer to set the environment “the old way”, you can do it manually:

  • clone or download repository from github
  • make sure to use Python version 3
  • create a virtualenv or
  • export/set PYTHONPATH
PYTHONPATH=/path/to/memacs
  • install dependencies
pip install -r requirements.txt

Getting Started

The basic concept of using a Memacs module is following:

  1. Choose a Memacs module you want to use and set it up:
    • Read the module descripion files in the docs folder.
    • Each module shares global options but also comes with its very own set of custom arguments.
    • Manually start the module of your choice from the bin folder of Memacs with the argument --help, e.g. bin/memacs_csv.py --help in your command line in order to get an overview of the arguments of this module.
    • You probably want to develop and test a script (=.bat= or =.sh=) for the module invocation in the command line and …
  2. When this script works as expected, set up a periodical invocation so that your data gets converted to Org mode via Memacs regularily.
  3. For an update from a running instance of Emacs, independent of a recurrent schedule (e.g., Memacs’ photo module after returning from an excursion), you may add a key binding to Emacs, e.g. C-c m p to your configuration
       (defun mp-update-memacs-photos ()
         "An extra (i.e., not cron-scheduled) run of Memacs' photo module."
         (interactive)
    	 (shell-command
    	   (format "~/org/update-memacs-photos.sh")
    	 )
       )
    
       (global-set-key (kbd "C-c m p") 'mp-update-memacs-photos)
        

    The script called requires the provision of the executable bit. Additional background of this technique is compiled by Mickey Petersen in Mastering Key Bindings in Emacs.

  4. Think of another Memacs module you might want to try ;-)

Please make sure you also read the FAQ’s and best practices, as it contains many tips and tricks on how to meet your requirements and on how to choose a reasonable setup.

Workflows

Here are some workflows just to give you an initial impression how Memacs may give you much for digital fun.

The Basics

When one or more Memacs modules are set-up and data starts flowing in to your Memacs Org mode files, you have many options to use Memacs for your personal workflows.

The most basic thing that changes with Memacs is that you might want to see Memacs-processed data in your agenda:

Either you are generating (1) Org mode files that are within your agenda files or you are generating (2) archive files whose more or less empty Org mode file stub is within your agenda files (as described in the FAQs).

This way, the generated time-stamp information gets into your normal agenda (1) or in the extended in archives-mode (by pressing v A in your agenda) that also shows content of the archive files (2).

Filename Time-Stamp and Friends

A Memacs feature I personally use all the time provides a somewhat more complex workflow whose basic data is provided by the filename time-stamp module. The module indexes all my files that contain ISO-datestamps or ISO-timestamps in their file names just like updatedb does for “locate”.

The fun starts, when this module is set-up and the file index is generated (nightly). With the elisp snippets mentioned in the module documentation, I am able to link to any of those files just by specifying their file name. This links never get broken since it does not matter in which folder files are located in any more.

Please refer to my Emacs configuration and look out for all occurrences of tsfile (time-stamp file) which is my custom link for those files.

I even extended this workflow such that my blog system is able to link to tsfile: images independent of their location. Awesome stuff.

Memacs Modules

This module is an example for developers: docs/memacs_csv.org

Those modules are not adopted to the new unified framework yet:

Following modules exist as a rough idea only and might get implemented some day (by you?):

Changelog

  • Version 2020.06.05.1
    • Features
    • Bugfixes
      • fix chrome.py output to include url and title for org headings
      • many improvements for the Chrome module
      • filenametimestamps: fixed check_datestamp_correctness (#97)
  • Version 2019.11.06.1
  • Versions prior to 2019-10-09.1 are not documented using this changelog. Please read the git commit messages.

Example Story

Imagine you are already using Memacs.

When remembering that day, when you joined an interesting talk about «Getting Things Done» (GTD), you start up your GNU Emacs with your main Org mode file. There you go to the Agenda-view and select this specific day a couple of months ago.

There it is, from 2pm to 3pm you scheduled this talk in your calendar. And then you realize that within this time frame, there appear some JPEG files containing an ISO 8601 time stamp[1] are indexed by one module. (filenametimestamp-module)

This image contains a slide you found interesting and which you photographed using your sleek smartphone. Who would remember having taken a picture during a talk?

Ten minutes after the talk you wrote a short message on Twitter where you mentioned useful URLs for your followers. This time those URLs are handy for yourself too! (Twitter-module)

On the evening of that day you see an entry of an incoming email from the author of the talk. Now you remember having had a cool conversation at the end of the talk where he promised you some additional information about that nice little GTD tool on his computer. Great that you got that link to that email too. Without Memacs you would probably never remembered that email again. (Maildir-module)

And then there were some bookmarks you saved this day, almost all related to great ideas you got from the GTD talk. (delicious-module)

This small story shows only a few use cases where different modules combine given data sources and their information to provide an overall view related to an event. Since Org mode has got links, no actual data has to be duplicated (except the meta data extracted by Memacs). Emails, files, bookmarks, and so forth are linked rather than copied.

[1] with periods instead of colons - just because the ancient limitations of Microsoft based file systems; like «2011-02-14T14.35.42 ideas.jpg»

Background

In 1945, Vannevar Bush wrote a famous article «As We May Think» where he develops the idea of having a «memory extender» called Memex. The memex can store all letters, books, and other information which are related to a person.

Besides having foreseen several technologies like hypertext, he defined a device that holds all metadata and data and provides associative trails to access information.

In the last decade of the previous century Microsoft Research had a research program that resulted in MyLifeBits. This software tried to store each information of the user like office documents, screenshots, name of active windows on the desktop computer, and even automatically took photographs (SenseCam). This word did not result in any (open) software product. Bell and Gemmell wrote a book called «Total Recall».

The Memacs project tries to implement the ideas of Vannevar Bush’s vision with open source and open standards. Hence, it’s name «Memacs» is the obvious combination of «GNU Emacs» and «Memex».

Memacs uses GNU Emacs Org mode to visualize and access information extracted by Memacs modules: using tags, time stamps, full text search, and so forth GNU Emacs is able to derive different views. The most important view probably is the Agenda-view where you can see anything that happened during a specific day/week/month according to the time frame selected. But you can derive other views too. For example you can choose to generate a condensed search result using a boolean combination of tags.

Related to Memacs, the project founder developed a research software called tagstore. This system allows users to store (local) files using tags without a hierarchy of folders. As a natural extension, tagstore targets associative access for (local) files. You might want to check out tagstore too. Memacs and tagstore are a very useful combination.

If you do like to know how to efficiently organize digital files in a simple and operating system independent way, read this blog post from Karl. It might give you ideas for your workflows as well.

Karl also wrote a whitepaper on Memacs which describes Memacs from a scientists point of view.

Similar Projects

Contribute! We are looking for your ideas:

If you want to contribute to this cool project, please fork and contribute or write an additional module!

See docs/FAQs_and_Best_Practices.org for more developing information.

We are sure that there are a lot of cool ideas for other modules out there! This is just the beginning!

Memacs is designed with respect to minimal effort for new modules.

We are using Python PEP8 and Test Driven Development (TDD).

License

Memacs is licensed under the GPLv3 license.

memacs's People

Contributors

ajft avatar awieser avatar balaramadurai avatar bighi avatar camdez avatar derbeutlin avatar dwinters42 avatar hrehfeld avatar ianbarton avatar jorgeazevedo avatar kidd avatar nbehrnd avatar nguyenhaiac avatar novoid avatar paul-wilkinson avatar punchagan avatar stvol avatar ypot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

memacs's Issues

--fetch-number for memacs-git

Hi!

Do you plan to add --fetch-number to the git memacs? I have a repo with several thousands commits, and that makes org's agenda hang.

I'd say --fetch-number should be supported by all memacs modules.

Cheers!

Marcelo.

memacs still at 0.0.18 after upgrading

Hello,

This may simply just be an issue with pip, but if I do pip list, I get memacs 0.0.18. If I do a pip install memacs --upgrade it tells me it's downloading 0.1, finding the old version of memacs, and installing the new one. However after the installation, pip list still reports 0.0.18.

I tried running the install with the -v option, and the only warning I see is warning: manifest_maker: standard file '-c' not found. Is this a package manager issue?

(I also tried doing a pip unistall followed by a pip install, but it did not seem to download anything, and I ended up with 0.0.18. As I don't see the file memacs_simplephonelogs.py, I assume it's still installing the old version.)

Browser extension: WorldBrain's Memex

Greetings!

After coming across this extension I thought about sharing what I've learned here for others if this seems unrelated, or pitching a software project please feel free to close this issue.

Yesterday I came across a browser extension from WorldBrain called Memex, it's inspired by Vannevar Bush's vision of a Memex.

After doing some initial digging around, I learned data generated using the extension could be exported locally to a JSON format. Upon learning this, I was curious about the possibilities of using this extension and its features and using a memacs module to create an org-file to view the information in emacs.

Some of its features include:

  • Full-Text Search in Web History & Bookmarks:
    Search with every word of all websites & PDFs you visited & filter by time, domain, tags or bookmarks

  • Web Annotations:
    Add notes to websites and pieces of text in them

  • Blazing fast and flexible organization
    Add bookmarks, tags or sort websites into lists on the fly.

If anyone has used the extension already or has thoughts about the extension I would love to hear them! Thank you for your time.

Migrate Memacs to Python 3

This is not complicated due to 2to3 which does most of the work.

However, many files have to be changed and many tests to be run.

Split up Memacs into separate moldule repositories?

As mentioned in #69, there seems to be an issue with having so many dependencies that are installed when a user is interested in one Memacs module only:

I, too, am worried on adding all requirements for all modules. When somebody is only interested in one (simple) Memacs module, why should she/he install a lot of dependencies. Maybe we did a conceptual mistake in the early stage when we decided to use one single repository for all different Memacs modules.

How to deal with this? Split up Memacs into separate repositories/packages (one module = one Python pip package/repository)?

Update memacs package in pypi or update installation instructions

Hello. The package in pypi is very old(2014) and don't have mumacs_mumail module. Ae there any plans on updating it? Or just update installation instructions, i'm getting

File "./memacs_mumail.py", line 5, in <module>
    from memacs.mu import MuMail
ImportError: No module named memacs.mu

I'm not very savvy with python and idk how to install this dependency by hands.

Don't depend on PIL

Trying to install memacs gives:

$ sudo pip install memacs
Downloading/unpacking memacs
  Downloading memacs-0.3.tar.gz (53kB): 53kB downloaded
  Running setup.py (path:/tmp/pip_build_root/memacs/setup.py) egg_info for package memacs

Downloading/unpacking PIL (from memacs)
  Could not find any downloads that satisfy the requirement PIL (from memacs)
  Some externally hosted files were ignored (use --allow-external PIL to allow).
Cleaning up...
No distributions at all found for PIL (from memacs)
Storing debug log for failure in /root/.pip/pip.log

I can work around this with pip install memacs --allow-external PIL --allow-unverified PIL but could you move to pillow instead? https://github.com/python-imaging/Pillow It's actively maintained and a drop-in replacement for PIL.

KODI/RaspberryPi video module

I'd like to have a tool for KODI/RaspberryPi which logs the names of the video files and the start+end time-stamp of playback to Memacs.

ImportError: cannot import name Memacs

I just installed memacs using pip (after installing python with homebrew on OS X). I added the folder to PYTHONPATH (which was empty), but when I launch I get a strange error:

~ python /usr/local/lib/python2.7/site-packages/memacs/example.pyc -h
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/memacs/example.py", line 9, in <module>
    from lib.memacs import Memacs
  File "/usr/local/lib/python2.7/site-packages/memacs/lib/memacs.py", line 8, in <module>
    from orgwriter import OrgOutputWriter
  File "/usr/local/lib/python2.7/site-packages/memacs/lib/orgwriter.py", line 11, in <module>
    from reader import CommonReader
  File "/usr/local/lib/python2.7/site-packages/memacs/lib/reader.py", line 7, in <module>
    import csv
  File "/usr/local/lib/python2.7/site-packages/memacs/csv.py", line 10, in <module>
    from lib.memacs import Memacs
ImportError: cannot import name Memacs

Is this circular dependency normal?

Provide a NixOS package for Memacs

Nix (of NixOS) allows you to write packages as self-contained, declarative services. Setting PATH variables, cloning the repo, then setting cronjobs for each desired module is many steps in the way of a process that could be as simple as a nix-env -i memacs.

Shortened ISO 8601 dates not recognized

I'm new here, so please forgive if I'm missing the obvious :-)

I have a variety of files with "shortend" ISO 8601 dates... either just the year, or the year and month - not all files apply to an exact date in my world.

For example:

2017_Alaska_Cruise.org

(the cruise spanned across a month change, so unless I put a range, even a month doesn't fit)

Maybe I'm being too literal with the ISO 8601 thing, but it seems that the standard allows for these dates, but memacs_filenametimestamps seems to just skip them.

Any reason it has to?

Actually, any reason it has to have a date at all and couldn't have an option to include all files (that it's pointed to). I realize that part of the use is to use with orgmode and agenda and dates, but the ability to "link through" to a file, even if just a filename with no date, seems of value.

Thanks!
Bruce

--add-to-time-stamps doesn't work at least with filenametimestamp module

See disabled unit tests starting with test_add_to_time_stamps_good_case() in https://github.com/novoid/Memacs/blob/master/memacs/tests/filenametimestamps_test.py

When enabled and run, it ends up in:

filenametimestamps_test.py:162: in call_add_to_time_stamps
    return memacs.test_get_entries()
../lib/memacs.py:216: in test_get_entries
    data = self.test_get_all()
../lib/memacs.py:205: in test_get_all
    self.__init(test=True)
../lib/memacs.py:86: in __init
    self._parser_parse_args()
../filenametimestamps.py:76: in _parser_parse_args
    Memacs._parser_parse_args(self)
../lib/memacs.py:167: in _parser_parse_args
    self._args = self._parser.parse_args(self.__argv)
../lib/argparser.py:166: in parse_args
    "to ,e.g., \"+1\" or \"-3\".")
/usr/lib/python3.5/argparse.py:2394: in error
    self.exit(2, _('%(prog)s: error: %(message)s\n') % args)

Maybe somebody wants to investigate.

use PEP 394 compliant shebang

I'm using Arch linux and the default python command refers to version 3.x, which is not compatible with memacs. It wouldn't be python if there isn't already a PEP standard for.

This PEP provides a convention to ensure that Python scripts can continue to be portable across *nix systems, regardless of the default version of the Python interpreter (i.e. the version invoked by the python command).

  • python2 will refer to some version of Python 2.x.
  • python3 will refer to some version of Python 3.x.
  • for the time being, all distributions should ensure that python refers to the same target as python2 .
  • however, end users should be aware that python refers to python3 on at least Arch Linux (that change is what prompted the creation of this PEP), so python should be used in the shebang line only for scripts that are source compatible with both Python 2 and 3.
  • in preparation for an eventual change in the default version of Python, Python 2 only scripts should either be updated to be source compatible with Python 3 or else to use python2 in the shebang line.

So would you mind changing it to python2?

SMS: add support for more elements

As mentioned in #65, when using signal-back in order to convert the encrypted backup file of Signal to an XML file to use with Memacs there are XML elements that are not supported yet. For example, mms is one of them.

  • Analysis of (all possible?) XML elements
  • support for (at least the most common) XML elements

memacs_lastfm fails, other modules work

Karl, I've been using memacs for a few years, and a month ago included memacs_lastfm to get my music listings. It was working for a few weeks, but following a system upgrade from ubuntu 17.10 to 18.04 the lastfm module has stopped working. All the other memacs modules that I use still work, but memacs_lastfm crashes with:

Traceback (most recent call last):
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/lastfm.py", line 76, in _main
network = pylast.get_lastfm_network(**options)
AttributeError: 'module' object has no attribute 'get_lastfm_network'
Traceback (most recent call last):
File "/home/ajft/src/memacs/bin/memacs_lastfm.py", line 27, in
memacs.handle_main()
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/lastfm.py", line 76, in _main
network = pylast.get_lastfm_network(**options)
AttributeError: 'module' object has no attribute 'get_lastfm_network'
Makefile:131: recipe for target 'lastfm.org_archive' failed
make: *** [lastfm.org_archive] Error 1

Is this a problem with memacs_lastfm, or have i managed to break my own installation of python modules (something I know nothing about, but seem to have any number of system-wide ubuntu packages, pip packages, etc)

Invalid year in filename - Traceback

I have a photograph that had incorrect exif data... so when it got renamed (via exiftool), it got an improbably year:

1899-12-30T00.00.00_P1000286.jpg_original

Now, I know the obvious is to fix the file, and I will, but I wanted to point out that it does cause an error and kills memacs_filenametimestamps.py.

Traceback below... My suggestion would be to just skip a file like that (as you do files without a date in the filename), but not sure if that's the best approach.

If you agree, I'll attempt to brush off my python and try to do a PR, but if nothing else, thought I would let you know.

Traceback (most recent call last):
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 194, in _main
self.__handle_folder(folder)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 107, in __handle_folder
self.__handle_file(file, rootdir)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 185, in __handle_file
self.__parse_file(file, link)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 120, in __parse_file
orgdate = OrgFormat.strdatetimeiso8601(timestamp)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 263, in strdatetimeiso8601
return OrgFormat.date(tuple_date, show_time=True)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 134, in date
return time.strftime("<%Y-%m-%d %a %H:%M>", local_structtime)
ValueError: year out of range
Traceback (most recent call last):
File "bin/memacs_filenametimestamps.py", line 39, in
memacs.handle_main()
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 194, in _main
self.__handle_folder(folder)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 107, in __handle_folder
self.__handle_file(file, rootdir)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 185, in __handle_file
self.__parse_file(file, link)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/filenametimestamps.py", line 120, in __parse_file
orgdate = OrgFormat.strdatetimeiso8601(timestamp)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 263, in strdatetimeiso8601
return OrgFormat.date(tuple_date, show_time=True)
File "/home/bdillahu/memacs/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 134, in date
return time.strftime("<%Y-%m-%d %a %H:%M>", local_structtime)
ValueError: year out of range

orgwriter: cannot concatenate 'str' and 'NoneType' objects

(At least) in module EXIF and IMAP:

Traceback (most recent call last):                                                                                                                    
     File "/home/nuno/memacs/local/lib/python2.7/site-packages/memacs/lib/memacs.py", line 183, in handle_main                                        
       self.__init()                                                                                                                                  
     File "/home/nuno/memacs/local/lib/python2.7/site-packages/memacs/lib/memacs.py", line 130, in __init                                             
       timestamp_delta=self._args.timestamp_delta)                                                                                                    
     File "/home/nuno/memacs/local/lib/python2.7/site-packages/memacs/lib/orgwriter.py", line 54, in __init__                                         
       logging.debug("orgwriter: timestamp_delta found: " + timestamp_delta)                                                                          
   TypeError: cannot concatenate 'str' and 'NoneType' objects

Or:

Traceback (most recent call last):                                                                                                                    
  File "/home/XXX/memacs/bin/memacs_imap.py", line 42, in <module>                                                                                    
    memacs.handle_main()                                                                                                                              
  File "/home/XXX/memacs/lib/python2.7/site-packages/memacs/lib/memacs.py", line 183, in handle_main                                                  
    self.__init()
  File "/home/XXX/memacs/lib/python2.7/site-packages/memacs/lib/memacs.py", line 130, in __init                                                       
    timestamp_delta=self._args.timestamp_delta)                                                                                                       
  File "/home/XXX/memacs/lib/python2.7/site-packages/memacs/lib/orgwriter.py", line 54, in __init__                                                   
    logging.debug("orgwriter: timestamp_delta found: " + timestamp_delta)                                                                             
TypeError: cannot concatenate 'str' and 'NoneType' objects

memacs_ical handling of events with no DTEND

I've just started using memacs_ical to parse my google calendar and found it was crashing on one entry. Investigation found that the offending event has a DTSTART but no DTEND.
BEGIN:VEVENT
DTSTART:20110822T231000Z
DTSTAMP:20151215T013238Z
UID:02082011132826501XMTDNW
CREATED:20110208T033417Z
DESCRIPTION:...
LAST-MODIFIED:20110316T051852Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:...
TRANSP:OPAQUE
END:VEVENT

memacs_ical.py dumps:
Traceback (most recent call last):
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/ical.py", line 173, in _main
self.__handle_vevent(component)
File "/home/ajft/src/memacs/memacs/ical.py", line 131, in __handle_vevent
dtend = self.__vtext_to_unicode(component.get('DTEND').to_ical())
AttributeError: 'NoneType' object has no attribute 'to_ical'
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/init.py", line 859, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/init.py", line 732, in format
return fmt.format(record)
File "/usr/lib/python2.7/logging/init.py", line 474, in format
s = self._fmt % record.dict
TypeError: not enough arguments for format string
Logged from file memacs.py, line 196
Traceback (most recent call last):
File "/usr/local/bin/memacs_ical.py", line 28, in
memacs.handle_main()
File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ajft/src/memacs/memacs/ical.py", line 173, in _main
self.__handle_vevent(component)
File "/home/ajft/src/memacs/memacs/ical.py", line 131, in __handle_vevent
dtend = self.__vtext_to_unicode(component.get('DTEND').to_ical())
AttributeError: 'NoneType' object has no attribute 'to_ical'
Makefile:60: recipe for target 'ical_monash.org_archive' failed
make: *** [ical_monash.org_archive] Error 1
(my workaround was to hunt back through my calendar to 2011-Aug-22 and edit the event to give it a duration)

org-link-abbrev-alist example not working as expected

Maybe my org/emacs magic isn't as strong as yours. Or maybe it's my OSX

I used your example:

(setq org-link-abbrev-alist
      '(
	("tsfile" . "~/path/to/memacs/files.org_archive::/\*.*%s/")
	))

And then when I clicked on my test link, I got Finder (the OSX file browser) popped up in that folder and I still had to find the file.

I change it to this:

(setq org-link-abbrev-alist
      '(
	("tsfile" . "~/path/to/memacs/files.org_archive/%s")
	))

And that worked fine

Failing Unittests

I would like to help on porting memacs to python 3 #52 but first it would be nice to have passing unittests.
I tried to fix the obvious ones #59 but for some my knowledge of the system is not sufficient.

  1. The GPX-Tests: For me the adress obtained differs from the expected one
- ** <2017-04-01 Sat 10:50> Alte Poststraße 150, 8020 Graz, Austria	:network:
?                             ^ ----------  ^^^
+ ** <2017-04-01 Sat 10:50> Eggenberger Allee 9, 8020 Graz, Austria	:network:
? 

If the gps data has changed this should be an easy fix.

  1. in memacs.tests.example_test.TestFoo and memacs.tests.rss_test.TestRss it seems like a line should be inserted in between the heading and the :PROPERTIES:. But I am not sure if this is really the case or the intention

  2. in memacs.tests.simplephonelogs_test.TestSimplePhoneLogsFull first of all the times are expected to be blank if they are equal to zero (e.g. when there is no shutdown before the boot) this should be fixed fairly quick if this is really the intention. Additionally the :HOURS_RUNTIME_EXTRAPOLATION: as well as the OFFICE_SUMMARY: are not expected by the tests.

It would be nice if you could tell me a bit about your intentions, then I might also be able to fix these tags.

AttributeError: type object 'OrgFormat' has no attribute 'datetime' - after ubuntu update

Following a two-stage upgrade of my linux box from 18.04 to 19.04 to 19.10, now whenever I run any of the memacs scripts (which have all been in place & running for years) they all fail with the above error about OrgFormat.

memacs is uptodate from github, in ~/src/memacs. With PYTHONPATH=/home/ajft/src/memacs,, as it has been for months or years, I get the following errors:
$ ~/src/memacs/bin/memacs_lastfm.py -a -c ~/.config/memacs/memacs-lastfm.ini
--output-format "{artist} -- {title}" -o ./lastfm.org_archive

Traceback (most recent call last):
File "/home/ubuntu/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ubuntu/src/memacs/memacs/lastfm.py", line 83, in _main
self._handle_recent_tracks(user.get_recent_tracks(limit=100))
File "/home/ubuntu/src/memacs/memacs/lastfm.py", line 57, in _handle_recent_tracks
self._writer.write_org_subitem(timestamp=OrgFormat.datetime(timestamp),
AttributeError: type object 'OrgFormat' has no attribute 'datetime'
Traceback (most recent call last):
File "/home/ubuntu/src/memacs/bin/memacs_lastfm.py", line 27, in
memacs.handle_main()
File "/home/ubuntu/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/ubuntu/src/memacs/memacs/lastfm.py", line 83, in _main
self._handle_recent_tracks(user.get_recent_tracks(limit=100))
File "/home/ubuntu/src/memacs/memacs/lastfm.py", line 57, in _handle_recent_tracks
self._writer.write_org_subitem(timestamp=OrgFormat.datetime(timestamp),
AttributeError: type object 'OrgFormat' has no attribute 'datetime'

memacs-imap and german umlauts are not working

Hi,

last weekend I have installed memacs-imap and it works fine for mails
without umlauts. If a mail includes umlauts something goes wrong.

I set up memacs imap last weekend and it works fine for mails with no umlauts.
But if a mail includes umlauts something goes wrong.

For example an email with the Subject "test ä ö ü ß" will be convertet to
"test =?utf-8?B?w6Qgw7Ygw7wgw58=?=".

I'm using OS X 10.10.2 with offlineimap.
Actually I'm not sure if this is a memacs or an offlineimap problem because
if I open the raw file from the maildirfolder the subject is also not displayed correctly.
But there is no problem showing the mail in mu4e.

Is there anybody who can help me?

Thanks,
Matthias

memacs-chrome --output-format?

Greetings,

Thank you for developing memacs and everyone who has contributed to the project. I've been trying to setup memacs for my knowledge system and running into a stumbling block.

When I run the command

python bin/memacs_chrome.py -f "/home/user/.config/google-chrome/Default/History" --output-format '{title}' >~/org/memacs/chromehist.org_archive

An entry in chromehist.org_archive file looks like this

 ** <2019-01-01 Tue 10:37> 
    :PROPERTIES:
   :URL:         https://www.emacswiki.org/
   :VISIT_COUNT: 1
   :ID:          2cea0d0cf79ed67415352fe702df96742b0b446a
   :END:

How can I get the memacs-chrome module to output the headings including the title of the url visited as shown in the example?

* Memacs for chrome url history           :Memacs:chrome:
** <2018-10-03 Wed 10:15:51> [[https://github.com/balaramadurai][Balaramadurai (Dr. Bala Ramadurai)]]
  :PROPERTIES:
  :URL:         https://github.com/balaramadurai
  :VISIT_COUNT: 1
  :ID:          72cdb9f8afd0bb8a815723c47a336f1f300a9228
  :END:

Thank you for your time and support.

how do you deal with HUGE data?

Hey,
The idea of Memacs is just beautiful. It's been on my TODO list for some time now and decided to give it a go.

As an addition to the modules there, I created one to fetch visited urls from firefox history. The problem is that over the last 6 months, I have more than 52k urls listed in ff's sqlite database, and although it's ok to export them to a 25Mb org file using memacs_cvs, emacs struggles even opening it (not to say integrating it into org-agenda).

Do you use any trick to lower the footprint of that? I guess having different files, one per month for example would be something, but if we follow that direction, probably pulling the data needed from sqlite directly and recreating the org file just for the needed days would probably be more functional.

Any ideas on that?

Ideas

First of all: great idea and ambitious project! Orgmode seems to be the right framework for doing something like this.

I don't have time to test it right now but I wanted to draw your attention towards some other project where you might be able to use code from:

  • You might be aware of the Zeitgeist project which powers the Gnome Activity Journal. It stores the time-related data and has an emacs provider:

https://code.launchpad.net/~patrickniedzielski/zeitgeist-datasources/emacs-zeitgeist
http://zeitgeist-project.com/

Maybe you can pull a big piece of information from the Zeitgeist API.

  • Then, I am interested in the semantic aspekts of this kind of automatic data collection. The dashboard project called it "implicit search" and with Icicles and Anything etc. Emacs kind of has this already. It would be nice to expand it not only to commands and text but to 'concepts' (like org files or subtrees or tags). See http://nat.org/dashboard/.

And actually, some effort in this direction has been made: http://www.remem.org/ (works within emacs, I haven't tested it, though). And of course, there is the Nepomuk Project which powers the semantic search in KDE: https://nepomuk.kde.org/
When it comes to communication and contacts, KDE's Akonadi seems to be a great central hub: http://community.kde.org/KDE_PIM/Akonadi

As I said, I like your concept and I am looking forward to checking it out. I am not a programmer, though.

importError: No module named datetime

Hello,
I totally love the idea of memacs and I have been using it actively for a few months now. Recently, I upgraded to Ubuntu 16.04LTS and then trouble started with the cronjobs.

Here is the error I get:

Traceback (most recent call last):
  File "/home/bala/memacs/bin/memacs_ical.py", line 5, in <module>
    from memacs.ical import CalendarMemacs
  File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/ical.py", line 9, in <module>
      File "/home/bala/memacs/bin/memacs_ical.py", line 5, in <module>
    from memacs.ical import CalendarMemacs
  File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/ical.py", line 9, in <module>
    from lib.memacs import Memacs
  File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/memacs.py", line 8, in <module>
from lib.memacs import Memacs
      File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/memacs.py", line 8, in <module>
from orgwriter import OrgOutputWriter
  File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/orgwriter.py", line 12, in <module>
    from orgwriter import OrgOutputWriter
      File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/orgwriter.py", line 12, in <module>
from orgformat import OrgFormat
  File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 11, in <module>
    from orgformat import OrgFormat
      File "/home/bala/memacs/local/lib/python2.7/site-packages/memacs/lib/orgformat.py", line 11, in <module>
import datetime
    ImportErrorimport datetime
: No module named datetimeImportError
: No module named datetime

Thanks

How does it work in windows?

I would like to give a fresh start on memacs.
But after i installed it, i have no idea how to use it.
I do not know how to configure it and execute it, and how to get the archive files.
Can you give me a little bit hint?

Add additional tags through command line

I use e.g. the csv module for multiple different purposes and therefore it would be nice if one could add additional tags through some command line parameter such that I could distinguish the different purposes through the tags.

Firefox history: add append mode

Somebody might volunteer for coding the append mode, where output is written to a file (instead of stdout as it is now) and new entries are compared with existing ones.

In append mode, only non-existing entries are appended. This is helpful when Firefox SQLite DB is a sliding window and Memacs output file should cover the whole story.

IMAP to local dovecot

Hi folks,

I'm curious about memacs, and just setting up - so I hope this isn't a stupid question. I have a local dovecot/maildir setup similar to the one described here: http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html

The key point is that in emacs I access that server like this:

(setq gnus-select-method '(nnimap "Mail"
(nnimap-shell-program
"/usr/lib/dovecot/imap -c ~/.dovecotrc")
(nnimap-stream shell)))

Is there a way to set up memacs_imap to execute this program, rather than connect to an external server?

Thanks!

memacs_phonecalls_superbackup python3 failure

After an update to my local install of memacs, a couple of the modules aren't working.

/home/xyzzy/src/memacs/bin/memacs_phonecalls_superbackup.py -a --add-to-time-stamps +10 -f /home/xyzzy/Dropbox/memacs/calllogs.xml -o ./calllogs.org_archive
Traceback (most recent call last):
File "/home/xyzzy/src/memacs/bin/memacs_phonecalls_superbackup.py", line 44, in
memacs.handle_main()
File "/home/xyzzy/src/memacs/memacs/lib/memacs.py", line 187, in handle_main
self._main()
File "/home/xyzzy/src/memacs/memacs/phonecalls_superbackup.py", line 236, in _main
self._args.minimum_duration,
File "/usr/lib/python3.6/xml/sax/init.py", line 48, in parseString
parser.parse(inpsrc)
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 111, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python3.6/xml/sax/xmlreader.py", line 125, in parse
self.feed(buffer)
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 217, in feed
self._parser.Parse(data, isFinal)
File "../Modules/pyexpat.c", line 414, in StartElement
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 333, in start_element
self._cont_handler.startElement(name, AttributesImpl(attrs))
File "/home/xyzzy/src/memacs/memacs/phonecalls_superbackup.py", line 131, in startElement
if call_duration < self._minimum_duration:
TypeError: '<' not supported between instances of 'int' and 'NoneType'

memacs_lastfm python3 error

After upgrading to the python3 version of memacs, my memacs_lastfm updates fail with:

$ /home/xyzzy/src/memacs/bin/memacs_lastfm.py -a -c /home/xyzzy/.config/memacs/memacs-lastfm.ini --output-format "{artist} -- {title}" -o ./lastfm.org_archive
ERROR:root:Traceback (most recent call last):
File "/home/xyzzy/src/memacs/memacs/lib/memacs.py", line 186, in handle_main
self.__init()
File "/home/xyzzy/src/memacs/memacs/lib/memacs.py", line 86, in __init
self._parser_parse_args()
File "/home/xyzzy/src/memacs/memacs/lastfm.py", line 40, in _parser_parse_args
self._args.output_format = self._args.output_format.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'
Traceback (most recent call last):
File "/home/xyzzy/src/memacs/bin/memacs_lastfm.py", line 27, in
memacs.handle_main()
File "/home/xyzzy/src/memacs/memacs/lib/memacs.py", line 186, in handle_main
self.__init()
File "/home/xyzzy/src/memacs/memacs/lib/memacs.py", line 86, in __init
self._parser_parse_args()
File "/home/xyzzy/src/memacs/memacs/lastfm.py", line 40, in _parser_parse_args
self._args.output_format = self._args.output_format.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

memacs_cal.py - No module named dateutil.tz

After installing memacs using virtualenv on OSX I get the following error:

please install python package "icalendar"
No module named dateutil.tz

Solution:

Within the virtualenv:

pip install python-dateutil

Can't get any module to work

I really love the idea behind this and I wish I could get it to work.

Here's what I have done so far (on ArchLinux and Mac OS, I get the same results):

$ pip3 install memacs # (as recommended in INSTALL.org)

Interestingly, this creates module files in ~/.local/lib/python-3.7/site-packages/memacs/ whose headers say #!/usr/bin/env python2!!

If I clone the repo into my home directory and run (for example):

$ PYTHONPATH=~/Memacs python3 ~/Memacs/bin/memacs_chrome.py -h, I get

ModuleNotFoundError: No module named 'lib'

and if I do

$ PYTHONPATH=~/Memacs:~/Memacs/memacs python3 ~/Memacs/bin/memacs_chrome.py -h

I get the following stack trace:

Traceback (most recent call last):
File "/Users/joe/Memacs/bin/memacs_chrome.py", line 5, in
from memacs.chrome import Chrome
File "/Users/joe/Memacs/memacs/chrome.py", line 13, in
from lib.memacs import Memacs
File "/Users/joe/Memacs/memacs/lib/memacs.py", line 8, in
from .orgwriter import OrgOutputWriter
File "/Users/joe/Memacs/memacs/lib/orgwriter.py", line 11, in
from .reader import CommonReader
File "/Users/joe/Memacs/memacs/lib/reader.py", line 7, in
import csv
File "/Users/joe/Memacs/memacs/csv.py", line 12, in
from .lib.orgformat import OrgFormat
ImportError: attempted relative import with no known parent package

I'm sure I'm missing something obvious here and I'd appreciate it if someone can point me in the right direction.

setup.py for publishing Memacs properly using pip3

Hi,

I've published multiple (simple) tools using Python3 pip. With Memacs, I do feel that my current knowledge and experience with pip is not enough.
Can you come up with a setup.py so that I may publish Memacs properly using pip?

The main things that are worrying me:

  • How to provide direct access to module (commands)?
  • How to properly handle requirements/dependencies? Is the current requirements.txt OK for this?
  • My other projects are (mis-)using the pip version scheme like 2018.08.02.1 (YYYY.MM.DD.). Is there a better way to generate version numbers? (I would like to see arguments for a different scheme than calendar-based)

My first approach for a Memacs setup.py is: https://gist.github.com/novoid/8468915f78e68e8d23c68f2e4df892e5

Please do help me here if you do have more experience in packaging Python projects like this!

Confusion about stub and archive files

First of all, thanks for Memacs! I've been using it for Twitter favorites (adapting the original Twitter module, inheriting from the same Memacs base class) and it has been working great so far. I might share the module after I figure out the following:

The generated file (the -o option when calling the module from the CLI), has the following in header text:

## To add this file to your org-agenda files open the stub file  (file.org) not this file(file.org_archive) with emacs and do following: M-x org-agenda-file-to-front

I'm confused though. First, when calling my module, I call it the following way:

python /home/fullofcaffeine/workspace/code/Memacs/bin/memacs_twitter_favorites.py -c ~/memacs.ini -o ~/caffeine/org/wiki/memacs/Twitter.org

That text seems to imply that the generated file is the archive file, why? Also I can't find any correspondent auto-generated Twitter.org_archive file. Also, what is the "stub" file and what is it supposed to contain? I also don't see the correspondent archive file anywhere.

Am I missing something?

Thanks in advance!

tagstore.org seems broken

The front page (readme) contains a link to tagstore.org, but that webpage seems to be something else entirely. Maybe it's been cybersquatted?

mumail: ValueError: time data does not match format

Helo. When running memacs-mumail, i'm getting

ValueError: time data 'Thu 08 Dec 2016 02:33:56 AM EET' does not match format '%c'

and this traceback:

Traceback (most recent call last):
     File "/usr/local/lib/python2.7/dist-packages/memacs/lib/memacs.py", line 187, in handle_main
       self._main()
     File "/usr/local/lib/python2.7/dist-packages/memacs/mu.py", line 116, in _main
       timestamp = self.__getTimestamp(datum)
     File "/usr/local/lib/python2.7/dist-packages/memacs/mu.py", line 71, in __getTimestamp
       mail_date = datetime.strptime(time,"%c")
     File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
       (data_string, format))
   ValueError: time data 'Thu 08 Dec 2016 02:33:56 AM EET' does not match format '%c'
Traceback (most recent call last):
  File "/usr/local/bin/memacs_mumail.py", line 31, in <module>
    memacs.handle_main()
  File "/usr/local/lib/python2.7/dist-packages/memacs/lib/memacs.py", line 187, in handle_main
    self._main()
  File "/usr/local/lib/python2.7/dist-packages/memacs/mu.py", line 116, in _main
    timestamp = self.__getTimestamp(datum)
  File "/usr/local/lib/python2.7/dist-packages/memacs/mu.py", line 71, in __getTimestamp
    mail_date = datetime.strptime(time,"%c")
  File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data 'Thu 08 Dec 2016 02:33:56 AM EET' does not match format '%c'

It's somehow releated to timestamp format(and how can i change it for memacs) or just a bug?

Unit test for phonecalls_superbackup

Anyone actually using phonecalls_superbackup should volunteer to write at least some basic unit tests so that we won't run into issues like #70 again.

Thanks!

filenametimestamps for YYYY-MM-DD_blah files

I've just started using memacs in a limited capacity, I have a large number of log files generated from other sources whose names are of the form YYYY-MM-DD_hostname.log eg "2013-03-08_zurich_data.log"

I would expect (and prefer) that an org-mode entry for them would be:

  • <2013-03-08 Fri> 2013-03-08_zurich_data.log
    instead I get entries of the form:

  • <2013-03-08 Fri 09:00:01> 2013-03-08_zurich_data.log

    Adrian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.