CSV Export Functionality and Use

What does this mean:
adds the CSV export format
Here:

Will it export a CSV of items? If not, what does?

If so, I do not see an export button.

This is someone else’s plugin but it looks to me like it just adds “csv” as an option to the “output formats” list that’s shown on show and browse pages.

It adds csv to the list of export formats- in the admin side, select the items you want to export then at the bottom of the page it will have a list of formats, of which csv will be one after you install the plugin. To run the export, just click ‘csv’ in that list of formats. I’ve had issues doing more than a page at a time using ‘select all’- it seems to work best with just selecting all of the items on one page at a time (whether it is 25, 50, etc.).

If it works like the other output formats, which it probably does, the checkboxes have no effect on the output. Those boxes (and the “select all” option) are only used for the bulk edit/delete features.

The output formats will always include just what’s on the page you clicked on them from: 1 item if from an item’s page, and a single page of results if coming from a browse page.

Wonderful. Thanks, Kate and John. Because I have 12K items, I decided to use this one instead:

But it seems like it is taking forever (more than 2 hours so far and it still says it’s in progress’). Once it is done, where does the CSV end up? And how to quit the job if I need to?

When I try using: Omeka Classic - CSV Export Format
and selecting all 12K items, only the 10 items on the page are exported. Is there a way to actually export all 12K items rather than 10?

So I think I need to use :Omeka Classic - Export
However do not know if it is really working, because it is serveral hours. Also how to stop it?

I see this:

and not able to locate:
items_browse_per_page.php

to add:
protected $_filters = array(
‘response_contexts’,
‘action_contexts’,
‘items_browse_per_page’,
);

See:

The method that we at the Omeka Team endorse and support for exporting CSV from your Omeka installation is a Python script, which you can get here.

The script runs on your local machine, or wherever you want (it isn’t a plugin and doesn’t need to be on the server where Omeka is installed). It uses the Omeka API to connect to the site remotely and get the CSV data that way. It handles paging through the API for you so there aren’t issues of having too many items or anything like that.

When I run
https://library.gc.cuny.edu/api/
or
https://library.gc.cuny.edu/api/resources/

I get these errors:
Traceback (most recent call last):
File “omekacsv.py”, line 101, in
response, content = request(endpoint, ‘resources’)
File “omekacsv.py”, line 51, in request
response = urlopen(url)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 222, in urlopen
return opener.open(url, data, timeout)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 531, in open
response = meth(req, response)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 641, in http_response
‘http’, request, response, code, msg, hdrs)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 569, in error
return self._call_chain(*args)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 503, in _call_chain
result = func(*args)
File “C:\Python\Python37-32\lib\urllib\request.py”, line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Any ideas?

That URL looks like it’s the front page for the library and not an Omeka site.

What’s the URL you go to for the front page of your Omeka install, or for the admin? As one example, the API URL you’d need to give there should be the same as the URL for the admin interface, just replacing “admin” with “api”.

API is enabled: https://library.gc.cuny.edu/legacy/api/site?pretty_print

The URL you mentioned this time is:

https://library.gc.cuny.edu/legacy/api

while the one you mentioned trying with the script that caused you problems was:

https://library.gc.cuny.edu/api

That “legacy” part is necessary.

Sorry, I mistyped above. I have been running on:
https://library.gc.cuny.edu/legacy/
which is our Omeka site

https://library.gc.cuny.edu/
is our library site

I can’t easily look at any of this from the outside since your site is behind access control.

If you’re still having problems, could you paste here the entire script run, from the line where you run it through the last line of the error message?

I think it is running now. I am using a different version of python. Stay tuned. Super appreciate your assist.

Incredible! It works! Thank you so much!!!

Do you have a recommendation to match the data in items_output.csv with files_output.csv, because I would like to attache in the latter to the records in the former?

I wrote a script matching the <ID> column in items_output with the <item ID> column in files_output. It was confusing because there was also an <ID> column in files_output.

Super appreciate all the support and hand-holding.

Thank you.

Yeah, a script could match them up as you’ve done, or something like a VLOOKUP or XLOOKUP function in a spreadsheet could as well.

I’m thinking about maybe offering an option or mode in the script itself to do the items and files as one combined output since so many people might want them together, though that would become a pretty big and possibly confusing sheet.